annotate lisp/gnus.el @ 25734:0242362bb1fe

(toplevel) [HAVE_TERMCAP_H]: Include termcap.h.
author Gerd Moellmann <gerd@gnu.org>
date Thu, 16 Sep 1999 12:52:12 +0000
parents 52eb67172ca0
children
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-organization nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
59 "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
60 The ORGANIZATION environment variable is used instead if it is defined.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
61 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
62 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
63 return a string.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
64
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
65 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
66 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
67 this file will be used as the organization.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
68
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
69 ;; Customization variables
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 ;; Don't touch this variable.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
72 (defvar gnus-nntp-service "nntp"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
73 "*NNTP service name (\"nntp\" or 119).
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
74 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
75 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
76 used to 899, you would say something along these lines:
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
77
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
78 (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
79
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
80 (defvar gnus-nntpserver-file "/etc/nntpserver"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
81 "*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
82
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
83 ;; This function is used to check both the environment variable
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
84 ;; 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
85 ;; an nntp server name default.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
86 (defun gnus-getenv-nntpserver ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
87 (or (getenv "NNTPSERVER")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
88 (and (file-readable-p gnus-nntpserver-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
89 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
90 (set-buffer (get-buffer-create " *gnus nntp*"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
91 (buffer-disable-undo (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
92 (insert-file-contents gnus-nntpserver-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
93 (let ((name (buffer-string)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
94 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
95 (if (string-match "^[ \t\n]*$" name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
96 nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
97 name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
98 (kill-buffer (current-buffer))))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
99
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
100 (defvar gnus-select-method
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
101 (nconc
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
102 (list 'nntp (or (condition-case ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
103 (gnus-getenv-nntpserver)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
104 (error nil))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
105 (if (and gnus-default-nntp-server
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
106 (not (string= gnus-default-nntp-server "")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
107 gnus-default-nntp-server)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
108 (system-name)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
109 (if (or (null gnus-nntp-service)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
110 (equal gnus-nntp-service "nntp"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
111 nil
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
112 (list gnus-nntp-service)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
113 "*Default method for selecting a newsgroup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
114 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
115 news is to be fetched, the second is the address.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
116
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
117 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
118 \"flab.flab.edu\", you could say:
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
119
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
120 (setq gnus-select-method '(nntp \"flab.flab.edu\"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
121
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
122 If you want to use your local spool, say:
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
123
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
124 (setq gnus-select-method (list 'nnspool (system-name)))
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 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
127
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
128 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
129 see the manual for details.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
130
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
131 (defvar gnus-message-archive-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
132 `(nnfolder
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
133 "archive"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
134 (nnfolder-directory ,(nnheader-concat message-directory "archive"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
135 (nnfolder-active-file
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
136 ,(nnheader-concat message-directory "archive/active"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
137 (nnfolder-get-new-mail nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
138 (nnfolder-inhibit-expiry t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
139 "*Method used for archiving messages you've sent.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
140 This should be a mail method.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
141
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
142 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
143 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
144 server buffer.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
145
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
146 (defvar gnus-message-archive-group nil
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
147 "*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
148 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
149 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
150 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
151 group (or nil) as a parameter.
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
152
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
153 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
154 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
155 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
156 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
157 \"nnml+private:mail.misc\", for instance.")
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
158
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
159 (defvar gnus-refer-article-method nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
160 "*Preferred method for fetching an article by Message-ID.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
161 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
162 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
163 nntp method, you might get acceptable results.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
164
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
165 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
166 in the documentation of `gnus-select-method'.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
167
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
168 (defvar gnus-secondary-select-methods nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
169 "*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
170 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
171 `gnus-select-method').
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
172
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
173 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
174 you could set this variable:
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
175
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
176 (setq gnus-secondary-select-methods '((nnml \"\")))")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
177
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
178 (defvar gnus-secondary-servers nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
179 "*List of NNTP servers that the user can choose between interactively.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
180 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
181 non-numeric prefix - `C-u M-x gnus', in short.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
182
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
183 (defvar gnus-nntp-server nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
184 "*The name of the host running the NNTP server.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
185 This variable is semi-obsolete. Use the `gnus-select-method'
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
186 variable instead.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
187
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
188 (defvar gnus-startup-file "~/.newsrc"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
189 "*Your `.newsrc' file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
190 `.newsrc-SERVER' will be used instead if that exists.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
191
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
192 (defvar gnus-init-file "~/.gnus"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
193 "*Your Gnus elisp startup file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
194 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
195 instead.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
196
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
197 (defvar gnus-group-faq-directory
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
198 '("/ftp@mirrors.aol.com:/pub/rtfm/usenet/"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
199 "/ftp@sunsite.auc.dk:/pub/usenet/"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
200 "/ftp@sunsite.doc.ic.ac.uk:/pub/usenet/news-faqs/"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
201 "/ftp@src.doc.ic.ac.uk:/usenet/news-FAQS/"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
202 "/ftp@ftp.seas.gwu.edu:/pub/rtfm/"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
203 "/ftp@rtfm.mit.edu:/pub/usenet/"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
204 "/ftp@ftp.uni-paderborn.de:/pub/FAQ/"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
205 "/ftp@ftp.sunet.se:/pub/usenet/"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
206 "/ftp@nctuccca.edu.tw:/USENET/FAQ/"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
207 "/ftp@hwarang.postech.ac.kr:/pub/usenet/"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
208 "/ftp@ftp.hk.super.net:/mirror/faqs/")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
209 "*Directory where the group FAQs are stored.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
210 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
211 fetched by ange-ftp.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
212
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
213 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
214 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
215 be used when being prompted for a site.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
216
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
217 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
218 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
219 something of value back from them.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
220
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
221 If the default site is too slow, try one of these:
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
222
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
223 North America: mirrors.aol.com /pub/rtfm/usenet
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
224 ftp.seas.gwu.edu /pub/rtfm
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
225 rtfm.mit.edu /pub/usenet
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
226 Europe: ftp.uni-paderborn.de /pub/FAQ
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
227 src.doc.ic.ac.uk /usenet/news-FAQS
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
228 ftp.sunet.se /pub/usenet
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
229 sunsite.auc.dk /pub/usenet
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
230 Asia: nctuccca.edu.tw /USENET/FAQ
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
231 hwarang.postech.ac.kr /pub/usenet
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
232 ftp.hk.super.net /mirror/faqs")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
233
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
234 (defvar gnus-group-archive-directory
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
235 "/ftp@ftp.hpc.uh.edu:/pub/emacs/ding-list/"
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
236 "*The address of the (ding) archives.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
237
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
238 (defvar gnus-group-recent-archive-directory
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
239 "/ftp@ftp.hpc.uh.edu:/pub/emacs/ding-list-recent/"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
240 "*The address of the most recent (ding) articles.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
241
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
242 (defvar gnus-default-subscribed-newsgroups nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
243 "*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
244 It should be a list of strings.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
245 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
246 started; it'll just use the normal newsgroups subscription methods.")
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-use-cross-reference t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
249 "*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
250 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
251 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
252 newsgroups.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
253
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
254 (defvar gnus-single-article-buffer t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
255 "*If non-nil, display all articles in the same buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
256 If nil, each group will get its own article buffer.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
257
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
258 (defvar gnus-use-dribble-file t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
259 "*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
260 If Emacs should crash without saving the .newsrc files, complete
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
261 information can be restored from the dribble file.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
262
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
263 (defvar gnus-dribble-directory nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
264 "*The directory where dribble files will be saved.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
265 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
266 saved will be used.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
267
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
268 (defvar gnus-asynchronous nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
269 "*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
270
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
271 (defvar gnus-kill-summary-on-exit t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
272 "*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
273 If nil, the summary will become a \"*Dead Summary*\" buffer, and
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
274 it will be killed sometime later.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
275
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
276 (defvar gnus-large-newsgroup 200
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
277 "*The number of articles which indicates a large newsgroup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
278 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
279 confirmation is required for selecting the newsgroup.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
280
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
281 ;; Suggested by Andrew Eskilsson <pi92ae@lelle.pt.hk-r.se>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
282 (defvar gnus-no-groups-message "No news is horrible news"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
283 "*Message displayed by Gnus when no groups are available.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
284
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
285 (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
286 "*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
287 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
288
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
289 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
290 `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
291 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
292 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
293 will not be used for kill files.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
294
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
295 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
296 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
297 to nil while on all other systems it defaults to t.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
298
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
299 (defvar gnus-article-save-directory gnus-directory
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
300 "*Name of the directory articles will be saved in (default \"~/News\").")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
301
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
302 (defvar gnus-kill-files-directory gnus-directory
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
303 "*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
304
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
305 (defvar gnus-default-article-saver 'gnus-summary-save-in-rmail
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
306 "*A function to save articles in your favorite format.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
307 The function must be interactively callable (in other words, it must
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
308 be an Emacs command).
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
309
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
310 Gnus provides the following functions:
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
311
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
312 * gnus-summary-save-in-rmail (Rmail format)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
313 * gnus-summary-save-in-mail (Unix mail format)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
314 * gnus-summary-save-in-folder (MH folder)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
315 * gnus-summary-save-in-file (article format).
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
316 * gnus-summary-save-in-vm (use VM's folder format).")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
317
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
318 (defvar gnus-prompt-before-saving 'always
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
319 "*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
320 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
321 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
322 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
323 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
324 `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
325 each invocation of the saving commands.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
326
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
327 (defvar gnus-rmail-save-name (function gnus-plain-save-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
328 "*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
329 The function is called with NEWSGROUP, HEADERS, and optional LAST-FILE.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
330
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
331 (defvar gnus-mail-save-name (function gnus-plain-save-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
332 "*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
333 The function is called with NEWSGROUP, HEADERS, and optional LAST-FILE.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
334
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
335 (defvar gnus-folder-save-name (function gnus-folder-save-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
336 "*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
337 The function is called with NEWSGROUP, HEADERS, and optional LAST-FOLDER.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
338
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
339 (defvar gnus-file-save-name (function gnus-numeric-save-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
340 "*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
341 The function is called with NEWSGROUP, HEADERS, and optional
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
342 LAST-FILE.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
343
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
344 (defvar gnus-split-methods
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
345 '((gnus-article-archive-name))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
346 "*Variable used to suggest where articles are to be saved.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
347 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
348 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
349 you could set this variable to something like:
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
350
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
351 '((\"^Subject:.*gnus\\|^Newsgroups:.*gnus\" \"gnus-stuff\")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
352 (\"^Subject:.*vm\\|^Xref:.*vm\" \"vm-stuff\"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
353
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
354 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
355 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
356
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
357 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
358 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
359 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
360 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
361
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
362 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
363 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
364 be used as possible file names.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
365
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
366 (defvar gnus-move-split-methods nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
367 "*Variable used to suggest where articles are to be moved to.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
368 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
369
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
370 (defvar gnus-save-score nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
371 "*If non-nil, save group scoring info.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
372
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
373 (defvar gnus-use-adaptive-scoring nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
374 "*If non-nil, use some adaptive scoring scheme.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
375
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
376 (defvar gnus-use-cache 'passive
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
377 "*If nil, Gnus will ignore the article cache.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
378 If `passive', it will allow entering (and reading) articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
379 explicitly entered into the cache. If anything else, use the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
380 cache to the full extent of the law.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
381
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
382 (defvar gnus-use-trees nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
383 "*If non-nil, display a thread tree buffer.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
384
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
385 (defvar gnus-use-grouplens nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
386 "*If non-nil, use GroupLens ratings.")
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-keep-backlog nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
389 "*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
390 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
391 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
392 articles. This is not a good idea.")
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-use-nocem nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
395 "*If non-nil, Gnus will read NoCeM cancel messages.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
396
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
397 (defvar gnus-use-demon nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
398 "If non-nil, Gnus might use some demons.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
399
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
400 (defvar gnus-use-scoring t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
401 "*If non-nil, enable scoring.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
402
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
403 (defvar gnus-use-picons nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
404 "*If non-nil, display picons.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
405
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
406 (defvar gnus-fetch-old-headers nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
407 "*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
408 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
409 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
410 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
411 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
412 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
413 headers to connect otherwise loose threads will be displayed.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
414 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
415 number of old headers will be fetched.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
416
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
417 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
418
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
419 ;see gnus-cus.el
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
420 ;(defvar gnus-visual t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
421 ; "*If non-nil, will do various highlighting.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
422 ;If nil, no mouse highlights (or any other highlights) will be
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
423 ;performed. This might speed up Gnus some when generating large group
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
424 ;and summary buffers.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
425
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
426 (defvar gnus-novice-user t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
427 "*Non-nil means that you are a usenet novice.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
428 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
429 required.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
430
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
431 (defvar gnus-expert-user nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
432 "*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
433 And that means *anything*.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
434
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
435 (defvar gnus-verbose 7
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
436 "*Integer that says how verbose Gnus should be.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
437 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
438 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
439 display most important messages; and at ten, Gnus will keep on
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
440 jabbering all the time.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
441
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
442 (defvar gnus-keep-same-level nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
443 "*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
444 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
445 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
446 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
447 buffer.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
448 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
449 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
450 available, the next newsgroup with the lowest possible level higher
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
451 than the current level.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
452 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
453 with the best level.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
454
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
455 (defvar gnus-summary-make-false-root 'adopt
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
456 "*nil means that Gnus won't gather loose threads.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
457 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
458 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
459 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
460 scattered all over the summary buffer, Gnus can gather them.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
461
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
462 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
463 original thread into one large thread.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
464
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
465 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
466 `dummy' or `empty'.
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 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
469 present the sub-threads after another.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
470 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
471 have all the sub-threads as children.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
472 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
473 the parent and mark all the step-children as such.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
474 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
475 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
476 given by the `gnus-summary-same-subject' variable.)")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
477
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
478 (defvar gnus-summary-gather-exclude-subject "^ *$\\|^(none)$"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
479 "*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
480 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
481 there can be many false gatherings performed. By rooting out certain
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
482 common subjects, gathering might become saner.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
483
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
484 (defvar gnus-summary-gather-subject-limit nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
485 "*Maximum length of subject comparisons when gathering loose threads.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
486 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
487 number will help gather threads that have been corrupted by
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
488 newsreaders chopping off subject lines, but it might also mean that
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
489 unrelated articles that have subject that happen to begin with the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
490 same few characters will be incorrectly gathered.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
491
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
492 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
493 comparing subjects.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
494
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
495 (defvar gnus-simplify-ignored-prefixes nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
496 "*Regexp, matches for which are removed from subject lines when simplifying.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
497
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
498 (defvar gnus-build-sparse-threads nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
499 "*If non-nil, fill in the gaps in threads.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
500 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
501 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
502 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
503
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
504 (defvar gnus-summary-thread-gathering-function 'gnus-gather-threads-by-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
505 "Function used for gathering loose threads.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
506 There are two pre-defined functions: `gnus-gather-threads-by-subject',
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
507 which only takes Subjects into consideration; and
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
508 `gnus-gather-threads-by-references', which compared the References
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
509 headers of the articles to find matches.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
510
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
511 ;; Added by Per Abrahamsen <amanda@iesd.auc.dk>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
512 (defvar gnus-summary-same-subject ""
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
513 "*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
514 This variable will only be used if the value of
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
515 `gnus-summary-make-false-root' is `empty'.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
516
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
517 (defvar gnus-summary-goto-unread t
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
518 "*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
519 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
520 whether it is read or not.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
521
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
522 (defvar gnus-group-goto-unread t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
523 "*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
524
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
525 (defvar gnus-goto-next-group-when-activating t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
526 "*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
527
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
528 (defvar gnus-check-new-newsgroups t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
529 "*Non-nil means that Gnus will add new newsgroups at startup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
530 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
531 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
532 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
533 nil.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
534
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
535 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
536 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
537 query for new groups from all those servers.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
538
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
539 Eg.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
540 (setq gnus-check-new-newsgroups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
541 '((nntp \"some.server\") (nntp \"other.server\")))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
542
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
543 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
544 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
545
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
546 (defvar gnus-check-bogus-newsgroups nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
547 "*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
548 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
549 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
550
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
551 (defvar gnus-read-active-file t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
552 "*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
553 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
554 `.newsrc' file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
555
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
556 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
557 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
558 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
559 generally be faster than both the t and nil value.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
560
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
561 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
562 be told about new newsgroups that arrive. To do that, set
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
563 `gnus-check-new-newsgroups' to `ask-server'. This may not work
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
564 properly with all servers.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
565
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
566 (defvar gnus-level-subscribed 5
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
567 "*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
568
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
569 (defvar gnus-level-unsubscribed 7
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
570 "*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
571 Groups with levels less than `gnus-level-subscribed', which should be
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
572 less than this variable, are subscribed.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
573
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
574 (defvar gnus-level-zombie 8
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
575 "*Groups with this level are zombie groups.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
576
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
577 (defvar gnus-level-killed 9
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
578 "*Groups with this level are killed.")
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-default-subscribed 3
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
581 "*New subscribed groups will be subscribed at this level.")
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-default-unsubscribed 6
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
584 "*New unsubscribed groups will be unsubscribed at this level.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
585
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
586 (defvar gnus-activate-level (1+ gnus-level-subscribed)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
587 "*Groups higher than this level won't be activated on startup.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
588 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
589 you have many groups that you aren't interested in.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
590
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
591 (defvar gnus-activate-foreign-newsgroups 4
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
592 "*If nil, Gnus will not check foreign newsgroups at startup.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
593 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
594 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
595 activated on startup. For instance, if you want to active all
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
596 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
597 `gnus-level-subscribed'.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
598
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
599 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
600 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
601 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
602 groups.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
603
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
604 (defvar gnus-save-newsrc-file t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
605 "*Non-nil means that Gnus will save the `.newsrc' file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
606 Gnus always saves its own startup file, which is called
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
607 \".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
608 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
609 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
610 exit.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
611
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
612 (defvar gnus-save-killed-list t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
613 "*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
614 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
615 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
616 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
617 the automatic new newsgroups subscription methods become meaningless.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
618
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
619 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
620 nil if you set this variable to nil.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
621
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
622 (defvar gnus-interactive-catchup t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
623 "*If non-nil, require your confirmation when catching up a group.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
624
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
625 (defvar gnus-interactive-exit t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
626 "*If non-nil, require your confirmation when exiting Gnus.")
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-kill-killed t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
629 "*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
630 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
631 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
632 of time.")
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-extract-address-components 'gnus-extract-address-components
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
635 "*Function for extracting address components from a From header.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
636 Two pre-defined function exist: `gnus-extract-address-components',
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
637 which is the default, quite fast, and too simplistic solution, and
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
638 `mail-extract-address-components', which works much better, but is
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
639 slower.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
640
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
641 (defvar gnus-summary-default-score 0
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
642 "*Default article score level.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
643 If this variable is nil, scoring will be disabled.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
644
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
645 (defvar gnus-summary-zcore-fuzz 0
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
646 "*Fuzziness factor for the zcore in the summary buffer.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
647 Articles with scores closer than this to `gnus-summary-default-score'
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
648 will not be marked.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
649
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
650 (defvar gnus-simplify-subject-fuzzy-regexp nil
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
651 "*Strings to be removed when doing fuzzy matches.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
652 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
653 that will be removed from subject strings if fuzzy subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
654 simplification is selected.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
655
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
656 (defvar gnus-permanently-visible-groups nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
657 "*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
658 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
659 articles in the groups.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
660
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
661 (defvar gnus-list-groups-with-ticked-articles t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
662 "*If non-nil, list groups that have only ticked articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
663 If nil, only list groups that have unread articles.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
664
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
665 (defvar gnus-group-default-list-level gnus-level-subscribed
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
666 "*Default listing level.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
667 Ignored if `gnus-group-use-permanent-levels' is non-nil.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
668
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
669 (defvar gnus-group-use-permanent-levels nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
670 "*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
671
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
672 (defvar gnus-group-list-inactive-groups t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
673 "*If non-nil, inactive groups will be listed.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
674
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
675 (defvar gnus-show-mime nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
676 "*If non-nil, do mime processing of articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
677 The articles will simply be fed to the function given by
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
678 `gnus-show-mime-method'.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
679
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
680 (defvar gnus-strict-mime t
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
681 "*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
682
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
683 (defvar gnus-show-mime-method 'metamail-buffer
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
684 "*Function to process a MIME message.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
685 The function is called from the article buffer.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
686
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
687 (defvar gnus-decode-encoded-word-method (lambda ())
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
688 "*Function to decode a MIME encoded-words.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
689 The function is called from the article buffer.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
690
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
691 (defvar gnus-show-threads t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
692 "*If non-nil, display threads in summary mode.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
693
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
694 (defvar gnus-thread-hide-subtree nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
695 "*If non-nil, hide all threads initially.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
696 If threads are hidden, you have to run the command
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
697 `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
698 to expose hidden threads.")
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-killed t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
701 "*If non-nil, hide killed threads automatically.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
702
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
703 (defvar gnus-thread-ignore-subject nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
704 "*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
705 If nil, which is the default, articles that have different subjects
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
706 from their parents will start separate threads.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
707
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
708 (defvar gnus-thread-operation-ignore-subject t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
709 "*If non-nil, subjects will be ignored when doing thread commands.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
710 This affects commands like `gnus-summary-kill-thread' and
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
711 `gnus-summary-lower-thread'.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
712
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
713 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
714 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
715 variable is `fuzzy', only articles that have subjects that are fuzzily
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
716 equal will be included.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
717
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
718 (defvar gnus-thread-indent-level 4
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
719 "*Number that says how much each sub-thread should be indented.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
720
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
721 (defvar gnus-ignored-newsgroups
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
722 (purecopy (mapconcat 'identity
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
723 '("^to\\." ; not "real" groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
724 "^[0-9. \t]+ " ; all digits in name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
725 "[][\"#'()]" ; bogus characters
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
726 )
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
727 "\\|"))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
728 "*A regexp to match uninteresting newsgroups in the active file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
729 Any lines in the active file matching this regular expression are
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
730 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
731 thus making them effectively non-existent.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
732
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
733 (defvar gnus-ignored-headers
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
734 "^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
735 "*All headers that match this regexp will be hidden.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
736 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
737 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
738
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
739 (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
740 "*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
741 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
742 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
743
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
744 (defvar gnus-sorted-header-list
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
745 '("^From:" "^Subject:" "^Summary:" "^Keywords:" "^Newsgroups:" "^To:"
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
746 "^Cc:" "^Date:" "^Organization:")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
747 "*This variable is a list of regular expressions.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
748 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
749 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
750 this list.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
751
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
752 (defvar gnus-boring-article-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
753 '(empty followup-to reply-to)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
754 "*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
755 Possible values in this list are `empty', `newsgroups', `followup-to',
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
756 `reply-to', and `date'.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
757
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
758 (defvar gnus-show-all-headers nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
759 "*If non-nil, don't hide any headers.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
760
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
761 (defvar gnus-save-all-headers t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
762 "*If non-nil, don't remove any headers before saving.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
763
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
764 (defvar gnus-saved-headers gnus-visible-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
765 "*Headers to keep if `gnus-save-all-headers' is nil.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
766 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
767 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
768 will be kept while the rest will be deleted before saving.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
769
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
770 (defvar gnus-inhibit-startup-message nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
771 "*If non-nil, the startup message will not be displayed.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
772
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
773 (defvar gnus-signature-separator "^-- *$"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
774 "Regexp matching signature separator.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
775
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
776 (defvar gnus-signature-limit nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
777 "Provide a limit to what is considered a signature.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
778 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
779 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
780 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
781 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
782 matches, the text in question is not a signature.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
783
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
784 (defvar gnus-auto-extend-newsgroup t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
785 "*If non-nil, extend newsgroup forward and backward when requested.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
786
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
787 (defvar gnus-auto-select-first t
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
788 "*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
789 If this variable is `best', select the highest-scored unread article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
790 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
791 article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
792
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
793 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
794 in some newsgroups, set the variable to nil in
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
795 `gnus-select-group-hook'.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
796
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
797 (defvar gnus-auto-select-next t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
798 "*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
799 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
800 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
801 nor t, Gnus will select the following unread newsgroup. In
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
802 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
803 newsgroup will be selected without any confirmation, and if it is
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
804 `almost-quietly', the next group will be selected without any
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
805 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
806 Finally, if this variable is `slightly-quietly', the `Z n' command
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
807 will go to the next group without confirmation.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
808
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
809 (defvar gnus-auto-select-same nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
810 "*If non-nil, select the next article with the same subject.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
811
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
812 (defvar gnus-summary-check-current nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
813 "*If non-nil, consider the current article when moving.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
814 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
815 current article is unread.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
816
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
817 (defvar gnus-auto-center-summary t
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
818 "*If non-nil, always center the current summary buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
819 In particular, if `vertical' do only vertical recentering. If non-nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
820 and non-`vertical', do both horizontal and vertical recentering.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
821
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
822 (defvar gnus-break-pages t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
823 "*If non-nil, do page breaking on articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
824 The page delimiter is specified by the `gnus-page-delimiter'
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
825 variable.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
826
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
827 (defvar gnus-page-delimiter "^\^L"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
828 "*Regexp describing what to use as article page delimiters.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
829 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
830 beginning of a line.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
831
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
832 (defvar gnus-use-full-window t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
833 "*If non-nil, use the entire Emacs screen.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
834
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
835 (defvar gnus-window-configuration nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
836 "Obsolete variable. See `gnus-buffer-configuration'.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
837
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
838 (defvar gnus-window-min-width 2
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
839 "*Minimum width of Gnus buffers.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
840
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
841 (defvar gnus-window-min-height 1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
842 "*Minimum height of Gnus buffers.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
843
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
844 (defvar gnus-buffer-configuration
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
845 '((group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
846 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
847 (group 1.0 point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
848 (if gnus-carpal '(group-carpal 4))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
849 (summary
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
850 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
851 (summary 1.0 point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
852 (if gnus-carpal '(summary-carpal 4))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
853 (article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
854 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
855 (gnus-use-picons
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
856 '(frame 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
857 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
858 (summary 0.25 point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
859 (if gnus-carpal '(summary-carpal 4))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
860 (article 1.0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
861 (vertical ((height . 5) (width . 15)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
862 (user-position . t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
863 (left . -1) (top . 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
864 (picons 1.0))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
865 (gnus-use-trees
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
866 '(vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
867 (summary 0.25 point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
868 (tree 0.25)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
869 (article 1.0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
870 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
871 '(vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
872 (summary 0.25 point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
873 (if gnus-carpal '(summary-carpal 4))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
874 (article 1.0)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
875 (server
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
876 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
877 (server 1.0 point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
878 (if gnus-carpal '(server-carpal 2))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
879 (browse
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
880 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
881 (browse 1.0 point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
882 (if gnus-carpal '(browse-carpal 2))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
883 (message
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
884 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
885 (message 1.0 point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
886 (pick
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
887 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
888 (article 1.0 point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
889 (info
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 (info 1.0 point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
892 (summary-faq
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 (summary 0.25)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
895 (faq 1.0 point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
896 (edit-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
897 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
898 (group 0.5)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
899 (edit-group 1.0 point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
900 (edit-server
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
901 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
902 (server 0.5)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
903 (edit-server 1.0 point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
904 (edit-score
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
905 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
906 (summary 0.25)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
907 (edit-score 1.0 point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
908 (post
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
909 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
910 (post 1.0 point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
911 (reply
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
912 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
913 (article-copy 0.5)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
914 (message 1.0 point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
915 (forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
916 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
917 (message 1.0 point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
918 (reply-yank
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
919 (vertical 1.0
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 (mail-bounce
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 (article 0.5)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
924 (message 1.0 point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
925 (draft
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
926 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
927 (draft 1.0 point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
928 (pipe
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
929 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
930 (summary 0.25 point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
931 (if gnus-carpal '(summary-carpal 4))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
932 ("*Shell Command Output*" 1.0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
933 (bug
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
934 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
935 ("*Gnus Help Bug*" 0.5)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
936 ("*Gnus Bug*" 1.0 point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
937 (compose-bounce
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
938 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
939 (article 0.5)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
940 (message 1.0 point))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
941 "Window configuration for all possible Gnus buffers.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
942 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
943 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
944 rule used when displaying the group buffer; `summary', which names a
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
945 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
946 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
947 complete list of NAMEs.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
948
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
949 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
950 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
951 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
952 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
953 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
954 buffer configuration.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
955
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
956 (defvar gnus-window-to-buffer
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
957 '((group . gnus-group-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
958 (summary . gnus-summary-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
959 (article . gnus-article-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
960 (server . gnus-server-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
961 (browse . "*Gnus Browse Server*")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
962 (edit-group . gnus-group-edit-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
963 (edit-server . gnus-server-edit-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
964 (group-carpal . gnus-carpal-group-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
965 (summary-carpal . gnus-carpal-summary-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
966 (server-carpal . gnus-carpal-server-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
967 (browse-carpal . gnus-carpal-browse-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
968 (edit-score . gnus-score-edit-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
969 (message . gnus-message-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
970 (mail . gnus-message-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
971 (post-news . gnus-message-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
972 (faq . gnus-faq-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
973 (picons . "*Picons*")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
974 (tree . gnus-tree-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
975 (info . gnus-info-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
976 (article-copy . gnus-article-copy)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
977 (draft . gnus-draft-buffer))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
978 "Mapping from short symbols to buffer names or buffer variables.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
979
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
980 (defvar gnus-carpal nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
981 "*If non-nil, display clickable icons.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
982
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
983 (defvar gnus-subscribe-newsgroup-method 'gnus-subscribe-zombies
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
984 "*Function called with a group name when new group is detected.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
985 A few pre-made functions are supplied: `gnus-subscribe-randomly'
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
986 inserts new groups at the beginning of the list of groups;
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
987 `gnus-subscribe-alphabetically' inserts new groups in strict
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
988 alphabetic order; `gnus-subscribe-hierarchically' inserts new groups
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
989 in hierarchical newsgroup order; `gnus-subscribe-interactively' asks
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
990 for your decision; `gnus-subscribe-killed' kills all new groups;
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
991 `gnus-subscribe-zombies' will make all new groups into zombies.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
992
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
993 ;; Suggested by a bug report by Hallvard B Furuseth.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
994 ;; <h.b.furuseth@usit.uio.no>.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
995 (defvar gnus-subscribe-options-newsgroup-method
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
996 (function gnus-subscribe-alphabetically)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
997 "*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
998 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
999 \"no\" and \"alt\" hierarchies, you'd put the following in your
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1000 .newsrc file:
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1001
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1002 options -n no.all alt.all
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1003
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1004 Gnus will the subscribe all new newsgroups in these hierarchies with
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1005 the subscription method in this variable.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1006
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1007 (defvar gnus-subscribe-hierarchical-interactive nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1008 "*If non-nil, Gnus will offer to subscribe hierarchically.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1009 When a new hierarchy appears, Gnus will ask the user:
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1010
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1011 '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
1012
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1013 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
1014 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
1015 hierarchy in its entirety.")
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 (defvar gnus-group-sort-function 'gnus-group-sort-by-alphabet
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1018 "*Function used for sorting the group buffer.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1019 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
1020 for the groups to be sorted. Pre-made functions include
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1021 `gnus-group-sort-by-alphabet', `gnus-group-sort-by-unread',
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1022 `gnus-group-sort-by-level', `gnus-group-sort-by-score', and
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1023 `gnus-group-sort-by-rank'.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1024
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1025 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
1026 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
1027 list.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1028
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1029 ;; Mark variables suggested by Thomas Michanek
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1030 ;; <Thomas.Michanek@telelogic.se>.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1031 (defvar gnus-unread-mark ?
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1032 "*Mark used for unread articles.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1033 (defvar gnus-ticked-mark ?!
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1034 "*Mark used for ticked articles.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1035 (defvar gnus-dormant-mark ??
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1036 "*Mark used for dormant articles.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1037 (defvar gnus-del-mark ?r
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1038 "*Mark used for del'd articles.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1039 (defvar gnus-read-mark ?R
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1040 "*Mark used for read articles.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1041 (defvar gnus-expirable-mark ?E
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1042 "*Mark used for expirable articles.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1043 (defvar gnus-killed-mark ?K
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1044 "*Mark used for killed articles.")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1045 (defvar gnus-souped-mark ?F
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1046 "*Mark used for killed articles.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1047 (defvar gnus-kill-file-mark ?X
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1048 "*Mark used for articles killed by kill files.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1049 (defvar gnus-low-score-mark ?Y
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1050 "*Mark used for articles with a low score.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1051 (defvar gnus-catchup-mark ?C
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1052 "*Mark used for articles that are caught up.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1053 (defvar gnus-replied-mark ?A
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1054 "*Mark used for articles that have been replied to.")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1055 (defvar gnus-cached-mark ?*
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1056 "*Mark used for articles that are in the cache.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1057 (defvar gnus-saved-mark ?S
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1058 "*Mark used for articles that have been saved to.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1059 (defvar gnus-process-mark ?#
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1060 "*Process mark.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1061 (defvar gnus-ancient-mark ?O
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1062 "*Mark used for ancient articles.")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1063 (defvar gnus-sparse-mark ?Q
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1064 "*Mark used for sparsely reffed articles.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1065 (defvar gnus-canceled-mark ?G
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1066 "*Mark used for canceled articles.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1067 (defvar gnus-score-over-mark ?+
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1068 "*Score mark used for articles with high scores.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1069 (defvar gnus-score-below-mark ?-
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1070 "*Score mark used for articles with low scores.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1071 (defvar gnus-empty-thread-mark ?
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1072 "*There is no thread under the article.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1073 (defvar gnus-not-empty-thread-mark ?=
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1074 "*There is a thread under the article.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1075
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1076 (defvar gnus-view-pseudo-asynchronously nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1077 "*If non-nil, Gnus will view pseudo-articles asynchronously.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1078
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1079 (defvar gnus-view-pseudos nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1080 "*If `automatic', pseudo-articles will be viewed automatically.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1081 If `not-confirm', pseudos will be viewed automatically, and the user
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1082 will not be asked to confirm the command.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1083
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1084 (defvar gnus-view-pseudos-separately t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1085 "*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
1086 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
1087 list of parameters to that command.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1088
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1089 (defvar gnus-insert-pseudo-articles t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1090 "*If non-nil, insert pseudo-articles when decoding articles.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1091
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1092 (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
1093 "*Format of group lines.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1094 It works along the same lines as a normal formatting string,
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1095 with some simple extensions.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1096
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1097 %M Only marked articles (character, \"*\" or \" \")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1098 %S Whether the group is subscribed (character, \"U\", \"K\", \"Z\" or \" \")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1099 %L Level of subscribedness (integer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1100 %N Number of unread articles (integer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1101 %I Number of dormant articles (integer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1102 %i Number of ticked and dormant (integer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1103 %T Number of ticked articles (integer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1104 %R Number of read articles (integer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1105 %t Total number of articles (integer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1106 %y Number of unread, unticked articles (integer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1107 %G Group name (string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1108 %g Qualified group name (string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1109 %D Group description (string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1110 %s Select method (string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1111 %o Moderated group (char, \"m\")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1112 %p Process mark (char)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1113 %O Moderated group (string, \"(m)\" or \"\")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1114 %P Topic indentation (string)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1115 %l Whether there are GroupLens predictions for this group (string)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1116 %n Select from where (string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1117 %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
1118 %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
1119 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
1120 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
1121 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
1122 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
1123 group specifier.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1124
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1125 Text between %( and %) will be highlighted with `gnus-mouse-face' when
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1126 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
1127
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1128 Note that this format specification is not always respected. For
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1129 reasons of efficiency, when listing killed groups, this specification
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1130 is ignored altogether. If the spec is changed considerably, your
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1131 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
1132 groups.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1133
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1134 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
1135 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
1136 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
1137 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
1138 effect.")
13401
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 (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
1141 "*The format specification of the lines in the summary buffer.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1142
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1143 It works along the same lines as a normal formatting string,
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1144 with some simple extensions.
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 %N Article number, left padded with spaces (string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1147 %S Subject (string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1148 %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
1149 %n Name of the poster (string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1150 %a Extracted name of the poster (string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1151 %A Extracted address of the poster (string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1152 %F Contents of the From: header (string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1153 %x Contents of the Xref: header (string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1154 %D Date of the article (string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1155 %d Date of the article (string) in DD-MMM format
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1156 %M Message-id of the article (string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1157 %r References of the article (string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1158 %c Number of characters in the article (integer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1159 %L Number of lines in the article (integer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1160 %I Indentation based on thread level (a string of spaces)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1161 %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
1162 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
1163 %R \"A\" if this article has been replied to, \" \" otherwise (character)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1164 %U Status of this article (character, \"R\", \"K\", \"-\" or \" \")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1165 %[ Opening bracket (character, \"[\" or \"<\")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1166 %] Closing bracket (character, \"]\" or \">\")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1167 %> Spaces of length thread-level (string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1168 %< Spaces of length (- 20 thread-level) (string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1169 %i Article score (number)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1170 %z Article zcore (character)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1171 %t Number of articles under the current thread (number).
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1172 %e Whether the thread is empty or not (character).
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1173 %l GroupLens score (string).
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1174 %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
1175 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
1176 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
1177 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
1178 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
1179 summary specifier.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1180
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1181 Text between %( and %) will be highlighted with `gnus-mouse-face'
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1182 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
1183 such area.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1184
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1185 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
1186 with care. For reasons of efficiency, Gnus will compute what column
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1187 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
1188 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
1189 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
1190 which is bad enough.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1191
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1192 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
1193 possible.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1194
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1195 This restriction may disappear in later versions of Gnus.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1196
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1197 (defvar gnus-summary-dummy-line-format
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1198 "* %(: :%) %S\n"
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1199 "*The format specification for the dummy roots in the summary buffer.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1200 It works along the same lines as a normal formatting string,
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1201 with some simple extensions.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1202
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1203 %S The subject")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1204
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1205 (defvar gnus-summary-mode-line-format "Gnus: %%b [%A] %Z"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1206 "*The format specification for the summary mode line.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1207 It works along the same lines as a normal formatting string,
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1208 with some simple extensions:
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1209
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1210 %G Group name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1211 %p Unprefixed group name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1212 %A Current article number
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1213 %V Gnus version
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1214 %U Number of unread articles in the group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1215 %e Number of unselected articles in the group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1216 %Z A string with unread/unselected article counts
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1217 %g Shortish group name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1218 %S Subject of the current article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1219 %u User-defined spec
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1220 %s Current score file name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1221 %d Number of dormant articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1222 %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
1223 %E Number of articles expunged by the score files")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1224
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1225 (defvar gnus-article-mode-line-format "Gnus: %%b %S"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1226 "*The format specification for the article mode line.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1227 See `gnus-summary-mode-line-format' for a closer description.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1228
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1229 (defvar gnus-group-mode-line-format "Gnus: %%b {%M%:%S}"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1230 "*The format specification for the group mode line.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1231 It works along the same lines as a normal formatting string,
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1232 with some simple extensions:
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1233
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1234 %S The native news server.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1235 %M The native select method.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1236 %: \":\" if %S isn't \"\".")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1237
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1238 (defvar gnus-valid-select-methods
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1239 '(("nntp" post address prompt-address)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1240 ("nnspool" post address)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1241 ("nnvirtual" post-mail virtual prompt-address)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1242 ("nnmbox" mail respool address)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1243 ("nnml" mail respool address)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1244 ("nnmh" mail respool address)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1245 ("nndir" post-mail prompt-address address)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1246 ("nneething" none address prompt-address)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1247 ("nndoc" none address prompt-address)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1248 ("nnbabyl" mail address respool)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1249 ("nnkiboze" post virtual)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1250 ("nnsoup" post-mail address)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1251 ("nndraft" post-mail)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1252 ("nnfolder" mail respool address))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1253 "An alist of valid select methods.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1254 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
1255 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
1256 this method (ie. `post', `mail', `none' or whatever) or other
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1257 properties that this method has (like being respoolable).
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1258 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
1259 this variable. I think.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1260
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1261 (defvar gnus-updated-mode-lines '(group article summary tree)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1262 "*List of buffers that should update their mode lines.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1263 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
1264 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
1265 updated with information that may be pertinent.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1266 If this variable is nil, screen refresh may be quicker.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1267
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1268 ;; 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
1269 (defvar gnus-mode-non-string-length nil
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1270 "*Max length of mode-line non-string contents.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1271 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
1272 of the modeline intact.")
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 ;see gnus-cus.el
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1275 ;(defvar gnus-mouse-face 'highlight
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1276 ; "*Face used for mouse highlighting in Gnus.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1277 ;No mouse highlights will be done if `gnus-visual' is nil.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1278
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1279 (defvar gnus-summary-mark-below 0
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1280 "*Mark all articles with a score below this variable as read.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1281 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
1282 score file.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1283
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1284 (defvar gnus-article-sort-functions '(gnus-article-sort-by-number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1285 "*List of functions used for sorting articles in the summary buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1286 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
1287
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1288 (defvar gnus-thread-sort-functions '(gnus-thread-sort-by-number)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1289 "*List of functions used for sorting threads in the summary buffer.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1290 By default, threads are sorted by article number.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1291
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1292 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
1293 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
1294 the primary sort function should be the last. You should probably
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1295 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
1296 functions -- preferably first.
13401
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 Ready-mady functions include `gnus-thread-sort-by-number',
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1299 `gnus-thread-sort-by-author', `gnus-thread-sort-by-subject',
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1300 `gnus-thread-sort-by-date', `gnus-thread-sort-by-score' and
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1301 `gnus-thread-sort-by-total-score' (see `gnus-thread-score-function').")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1302
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1303 (defvar gnus-thread-score-function '+
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1304 "*Function used for calculating the total score of a thread.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1305
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1306 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
1307 subthread and should then return the score of the thread.
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 Some functions you can use are `+', `max', or `min'.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1310
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1311 (defvar gnus-summary-expunge-below nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1312 "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
1313
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1314 (defvar gnus-thread-expunge-below nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1315 "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
1316 See `gnus-thread-score-function' for en explanation of what a
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1317 \"thread score\" is.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1318
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1319 (defvar gnus-auto-subscribed-groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1320 "^nnml\\|^nnfolder\\|^nnmbox\\|^nnmh\\|^nnbabyl"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1321 "*All new groups that match this regexp will be subscribed automatically.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1322 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
1323 whatsoever on old groups.
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
1324
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
1325 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
1326 `gnus-subscribe-newsgroup-method'. Instead, they will
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
1327 be subscribed using `gnus-subscribe-options-newsgroup-method'.")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1328
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1329 (defvar gnus-options-subscribe nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1330 "*All new groups matching this regexp will be subscribed unconditionally.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1331 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
1332 does not affect old newsgroups.
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
1333
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
1334 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
1335 `gnus-subscribe-newsgroup-method'. Instead, they will
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
1336 be subscribed using `gnus-subscribe-options-newsgroup-method'.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1337
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1338 (defvar gnus-options-not-subscribe nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1339 "*All new groups matching this regexp will be ignored.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1340 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
1341 does not affect old (already subscribed) newsgroups.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1342
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1343 (defvar gnus-auto-expirable-newsgroups nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1344 "*Groups in which to automatically mark read articles as expirable.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1345 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
1346 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
1347
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1348 (defvar gnus-total-expirable-newsgroups nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1349 "*Groups in which to perform expiry of all read articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1350 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
1351 expiring - which means that all read articles will be deleted after
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1352 (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
1353 course.)")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1354
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1355 (defvar gnus-group-uncollapsed-levels 1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1356 "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
1357
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1358 (defvar gnus-hidden-properties '(invisible t intangible t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1359 "Property list to use for hiding text.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1360
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1361 (defvar gnus-modtime-botch nil
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1362 "*Non-nil means .newsrc should be deleted prior to save.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1363 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
1364 disc.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1365
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1366 ;; Hooks.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1367
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1368 (defvar gnus-group-mode-hook nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1369 "*A hook for Gnus group mode.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1370
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1371 (defvar gnus-summary-mode-hook nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1372 "*A hook for Gnus summary mode.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1373 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
1374
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1375 (defvar gnus-article-mode-hook nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1376 "*A hook for Gnus article mode.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1377
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1378 (defvar gnus-summary-prepare-exit-hook nil
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1379 "*A hook called when preparing to exit from the summary buffer.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1380 It calls `gnus-summary-expire-articles' by default.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1381 (add-hook 'gnus-summary-prepare-exit-hook 'gnus-summary-expire-articles)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1382
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1383 (defvar gnus-summary-exit-hook nil
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1384 "*A hook called on exit from the summary buffer.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1385
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1386 (defvar gnus-group-catchup-group-hook nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1387 "*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
1388
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1389 (defvar gnus-group-update-group-hook nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1390 "*A hook called when updating group lines.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1391
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1392 (defvar gnus-open-server-hook nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1393 "*A hook called just before opening connection to the news server.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1394
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1395 (defvar gnus-load-hook nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1396 "*A hook run while Gnus is loaded.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1397
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1398 (defvar gnus-startup-hook nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1399 "*A hook called at startup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1400 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
1401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1402 (defvar gnus-get-new-news-hook nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1403 "*A hook run just before Gnus checks for new news.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1404
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1405 (defvar gnus-after-getting-new-news-hook nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1406 "*A hook run after Gnus checks for new news.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1407
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1408 (defvar gnus-group-prepare-function 'gnus-group-prepare-flat
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1409 "*A function that is called to generate the group buffer.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1410 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
1411 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
1412 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
1413 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
1414 than this number should be displayed.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1415
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1416 The only current function implemented is `gnus-group-prepare-flat'.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1417
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1418 (defvar gnus-group-prepare-hook nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1419 "*A hook called after the group buffer has been generated.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1420 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
1421
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1422 (defvar gnus-summary-prepare-hook nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1423 "*A hook called after the summary buffer has been generated.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1424 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
1425
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1426 (defvar gnus-summary-generate-hook nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1427 "*A hook run just before generating the summary buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1428 This hook is commonly used to customize threading variables and the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1429 like.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1430
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1431 (defvar gnus-article-prepare-hook nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1432 "*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
1433 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
1434
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1435 ;(defvar gnus-article-display-hook nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1436 ; "*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
1437 ;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
1438 ;buffer. Typical functions that this hook may contain are
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1439 ;`gnus-article-hide-headers' (hide selected headers),
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1440 ;`gnus-article-maybe-highlight' (perform fancy article highlighting),
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1441 ;`gnus-article-hide-signature' (hide signature) and
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1442 ;`gnus-article-treat-overstrike' (turn \"^H_\" into bold characters).")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1443 ;(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
1444 ;(add-hook 'gnus-article-display-hook 'gnus-article-treat-overstrike)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1445 ;(add-hook 'gnus-article-display-hook 'gnus-article-maybe-highlight)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1446
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1447 (defvar gnus-article-x-face-too-ugly nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1448 "Regexp matching posters whose face shouldn't be shown automatically.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1449
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1450 (defvar gnus-select-group-hook nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1451 "*A hook called when a newsgroup is selected.
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 If you'd like to simplify subjects like the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1454 `gnus-summary-next-same-subject' command does, you can use the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1455 following hook:
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1456
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1457 (setq gnus-select-group-hook
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1458 (list
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1459 (lambda ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1460 (mapcar (lambda (header)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1461 (mail-header-set-subject
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1462 header
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1463 (gnus-simplify-subject
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1464 (mail-header-subject header) 're-only)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1465 gnus-newsgroup-headers))))")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1466
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1467 (defvar gnus-select-article-hook nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1468 "*A hook called when an article is selected.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1469
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1470 (defvar gnus-apply-kill-hook '(gnus-apply-kill-file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1471 "*A hook called to apply kill files to a group.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1472 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
1473 The function `gnus-apply-kill-file' is called by default.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1474
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1475 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
1476 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
1477 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
1478 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
1479 following hook:
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 (setq gnus-apply-kill-hook
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1482 (list
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1483 (lambda ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1484 (cond ((string-match \"control\" gnus-newsgroup-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1485 (gnus-kill \"Subject\" \"rmgroup\")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1486 (gnus-expunge \"X\"))))))")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1487
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1488 (defvar gnus-visual-mark-article-hook
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1489 (list 'gnus-highlight-selected-summary)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1490 "*Hook run after selecting an article in the summary buffer.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1491 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
1492 is not run if `gnus-visual' is nil.")
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-parse-headers-hook nil
13694
73433c3071a5 * gnus.el (gnus-parse-headers-hook): New hook.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 13579
diff changeset
1495 "*A hook called before parsing the headers.")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1496 (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
1497
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1498 (defvar gnus-exit-group-hook nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1499 "*A hook called when exiting (not quitting) summary mode.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1500
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1501 (defvar gnus-suspend-gnus-hook nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1502 "*A hook called when suspending (not exiting) Gnus.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1503
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1504 (defvar gnus-exit-gnus-hook nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1505 "*A hook called when exiting Gnus.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1506
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1507 (defvar gnus-after-exiting-gnus-hook nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1508 "*A hook called after exiting Gnus.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1509
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1510 (defvar gnus-save-newsrc-hook nil
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1511 "*A hook called before saving any of the newsrc files.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1512
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1513 (defvar gnus-save-quick-newsrc-hook nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1514 "*A hook called just before saving the quick newsrc file.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1515 Can be used to turn version control on or off.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1516
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1517 (defvar gnus-save-standard-newsrc-hook nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1518 "*A hook called just before saving the standard newsrc file.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1519 Can be used to turn version control on or off.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1520
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1521 (defvar gnus-summary-update-hook
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1522 (list 'gnus-summary-highlight-line)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1523 "*A hook called when a summary line is changed.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1524 The hook will not be called if `gnus-visual' is nil.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1525
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1526 The default function `gnus-summary-highlight-line' will
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1527 highlight the line according to the `gnus-summary-highlight'
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1528 variable.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1529
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1530 (defvar gnus-group-update-hook '(gnus-group-highlight-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1531 "*A hook called when a group line is changed.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1532 The hook will not be called if `gnus-visual' is nil.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1533
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1534 The default function `gnus-group-highlight-line' will
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1535 highlight the line according to the `gnus-group-highlight'
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1536 variable.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1537
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1538 (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
1539 "*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
1540 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
1541 automatically when it is selected.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1542
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1543 (defvar gnus-group-change-level-function nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1544 "Function run when a group level is changed.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1545 It is called with three parameters -- GROUP, LEVEL and OLDLEVEL.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1546
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1547 ;; Remove any hilit infestation.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1548 (add-hook 'gnus-startup-hook
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1549 (lambda ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1550 (remove-hook 'gnus-summary-prepare-hook
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1551 'hilit-rehighlight-buffer-quietly)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1552 (remove-hook 'gnus-summary-prepare-hook 'hilit-install-line-hooks)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1553 (setq gnus-mark-article-hook
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1554 '(gnus-summary-mark-read-and-unread-as-read))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1555 (remove-hook 'gnus-article-prepare-hook
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1556 'hilit-rehighlight-buffer-quietly)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1557
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1558
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1559 ;; Internal variables
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1560
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1561 (defvar gnus-tree-buffer "*Tree*"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1562 "Buffer where Gnus thread trees are displayed.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1563
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1564 ;; Dummy variable.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1565 (defvar gnus-use-generic-from nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1566
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1567 (defvar gnus-thread-indent-array nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1568 (defvar gnus-thread-indent-array-level gnus-thread-indent-level)
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 (defvar gnus-newsrc-file-version nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1571
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1572 (defvar gnus-method-history nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1573 ;; Variable holding the user answers to all method prompts.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1574
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1575 (defvar gnus-group-history nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1576 ;; Variable holding the user answers to all group prompts.
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-server-alist nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1579 "List of available servers.")
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-indentation-function nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1582
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1583 (defvar gnus-topic-indentation "") ;; Obsolete variable.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1584
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1585 (defvar gnus-goto-missing-group-function nil)
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-override-subscribe-method 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-group-goto-next-group-function nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1590 "Function to override finding the next group after listing groups.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1591
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1592 (defconst gnus-article-mark-lists
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1593 '((marked . tick) (replied . reply)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1594 (expirable . expire) (killed . killed)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1595 (bookmarks . bookmark) (dormant . dormant)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1596 (scored . score) (saved . save)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1597 (cached . cache)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1598 ))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1599
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1600 ;; Avoid highlighting in kill files.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1601 (defvar gnus-summary-inhibit-highlight nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1602 (defvar gnus-newsgroup-selected-overlay nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1603
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1604 (defvar gnus-inhibit-hiding nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1605 (defvar gnus-group-indentation "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1606 (defvar gnus-inhibit-limiting nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1607 (defvar gnus-created-frames nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1608
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1609 (defvar gnus-article-mode-map nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1610 (defvar gnus-dribble-buffer nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1611 (defvar gnus-headers-retrieved-by nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1612 (defvar gnus-article-reply nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1613 (defvar gnus-override-method nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1614 (defvar gnus-article-check-size nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1615
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1616 (defvar gnus-current-score-file nil)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1617 (defvar gnus-newsgroup-adaptive-score-file nil)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1618 (defvar gnus-scores-exclude-files nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1619
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1620 (defvar gnus-opened-servers nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1621
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1622 (defvar gnus-current-move-group nil)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1623 (defvar gnus-current-copy-group nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1624 (defvar gnus-current-crosspost-group nil)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1625
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1626 (defvar gnus-newsgroup-dependencies nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1627 (defvar gnus-newsgroup-async nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1628 (defconst gnus-group-edit-buffer "*Gnus edit newsgroup*")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1629
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1630 (defvar gnus-newsgroup-adaptive nil)
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-summary-display-table nil)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1633 (defvar gnus-summary-display-article-function nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1634
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1635 (defvar gnus-summary-highlight-line-function nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1636 "Function called after highlighting a summary line.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1637
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1638 (defvar gnus-group-line-format-alist
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1639 `((?M gnus-tmp-marked-mark ?c)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1640 (?S gnus-tmp-subscribed ?c)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1641 (?L gnus-tmp-level ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1642 (?N (cond ((eq number t) "*" )
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1643 ((numberp number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1644 (int-to-string
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1645 (+ number
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1646 (gnus-range-length (cdr (assq 'dormant gnus-tmp-marked)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1647 (gnus-range-length (cdr (assq 'tick gnus-tmp-marked))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1648 (t number)) ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1649 (?R gnus-tmp-number-of-read ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1650 (?t gnus-tmp-number-total ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1651 (?y gnus-tmp-number-of-unread ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1652 (?I (gnus-range-length (cdr (assq 'dormant gnus-tmp-marked))) ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1653 (?T (gnus-range-length (cdr (assq 'tick gnus-tmp-marked))) ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1654 (?i (+ (gnus-range-length (cdr (assq 'dormant gnus-tmp-marked)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1655 (gnus-range-length (cdr (assq 'tick gnus-tmp-marked)))) ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1656 (?g gnus-tmp-group ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1657 (?G gnus-tmp-qualified-group ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1658 (?c (gnus-short-group-name gnus-tmp-group) ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1659 (?D gnus-tmp-newsgroup-description ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1660 (?o gnus-tmp-moderated ?c)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1661 (?O gnus-tmp-moderated-string ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1662 (?p gnus-tmp-process-marked ?c)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1663 (?s gnus-tmp-news-server ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1664 (?n gnus-tmp-news-method ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1665 (?P gnus-group-indentation ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1666 (?l gnus-tmp-grouplens ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1667 (?z gnus-tmp-news-method-string ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1668 (?u gnus-tmp-user-defined ?s)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1669
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1670 (defvar gnus-summary-line-format-alist
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1671 `((?N ,(macroexpand '(mail-header-number gnus-tmp-header)) ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1672 (?S ,(macroexpand '(mail-header-subject gnus-tmp-header)) ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1673 (?s gnus-tmp-subject-or-nil ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1674 (?n gnus-tmp-name ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1675 (?A (car (cdr (funcall gnus-extract-address-components gnus-tmp-from)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1676 ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1677 (?a (or (car (funcall gnus-extract-address-components gnus-tmp-from))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1678 gnus-tmp-from) ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1679 (?F gnus-tmp-from ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1680 (?x ,(macroexpand '(mail-header-xref gnus-tmp-header)) ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1681 (?D ,(macroexpand '(mail-header-date gnus-tmp-header)) ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1682 (?d (gnus-dd-mmm (mail-header-date gnus-tmp-header)) ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1683 (?M ,(macroexpand '(mail-header-id gnus-tmp-header)) ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1684 (?r ,(macroexpand '(mail-header-references gnus-tmp-header)) ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1685 (?c (or (mail-header-chars gnus-tmp-header) 0) ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1686 (?L gnus-tmp-lines ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1687 (?I gnus-tmp-indentation ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1688 (?T (if (= gnus-tmp-level 0) "" (make-string (frame-width) ? )) ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1689 (?R gnus-tmp-replied ?c)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1690 (?\[ gnus-tmp-opening-bracket ?c)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1691 (?\] gnus-tmp-closing-bracket ?c)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1692 (?\> (make-string gnus-tmp-level ? ) ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1693 (?\< (make-string (max 0 (- 20 gnus-tmp-level)) ? ) ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1694 (?i gnus-tmp-score ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1695 (?z gnus-tmp-score-char ?c)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1696 (?l (bbb-grouplens-score gnus-tmp-header) ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1697 (?V (gnus-thread-total-score (and (boundp 'thread) (car thread))) ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1698 (?U gnus-tmp-unread ?c)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1699 (?t (gnus-summary-number-of-articles-in-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1700 (and (boundp 'thread) (car thread)) gnus-tmp-level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1701 ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1702 (?e (gnus-summary-number-of-articles-in-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1703 (and (boundp 'thread) (car thread)) gnus-tmp-level t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1704 ?c)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1705 (?u gnus-tmp-user-defined ?s))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1706 "An alist of format specifications that can appear in summary lines,
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1707 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
1708 variable (string, integer, character, etc).")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1709
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1710 (defvar gnus-summary-dummy-line-format-alist
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1711 `((?S gnus-tmp-subject ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1712 (?N gnus-tmp-number ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1713 (?u gnus-tmp-user-defined ?s)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1714
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1715 (defvar gnus-summary-mode-line-format-alist
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1716 `((?G gnus-tmp-group-name ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1717 (?g (gnus-short-group-name gnus-tmp-group-name) ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1718 (?p (gnus-group-real-name gnus-tmp-group-name) ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1719 (?A gnus-tmp-article-number ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1720 (?Z gnus-tmp-unread-and-unselected ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1721 (?V gnus-version ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1722 (?U gnus-tmp-unread-and-unticked ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1723 (?S gnus-tmp-subject ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1724 (?e gnus-tmp-unselected ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1725 (?u gnus-tmp-user-defined ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1726 (?d (length gnus-newsgroup-dormant) ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1727 (?t (length gnus-newsgroup-marked) ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1728 (?r (length gnus-newsgroup-reads) ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1729 (?E gnus-newsgroup-expunged-tally ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1730 (?s (gnus-current-score-file-nondirectory) ?s)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1731
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1732 (defvar gnus-article-mode-line-format-alist
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1733 gnus-summary-mode-line-format-alist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1734
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1735 (defvar gnus-group-mode-line-format-alist
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1736 `((?S gnus-tmp-news-server ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1737 (?M gnus-tmp-news-method ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1738 (?u gnus-tmp-user-defined ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1739 (?: gnus-tmp-colon ?s)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1740
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1741 (defvar gnus-have-read-active-file nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1742
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1743 (defconst gnus-maintainer
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1744 "gnus-bug@ifi.uio.no (The Gnus Bugfixing Girls + Boys)"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1745 "The mail address of the Gnus maintainers.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1746
15558
18364c2808f7 Wrong version number.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15557
diff changeset
1747 (defconst gnus-version-number "5.3"
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1748 "Version number for this version of Gnus.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1749
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1750 (defconst gnus-version (format "Gnus v%s" gnus-version-number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1751 "Version string for this version of Gnus.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1752
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1753 (defvar gnus-info-nodes
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1754 '((gnus-group-mode "(gnus)The Group Buffer")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1755 (gnus-summary-mode "(gnus)The Summary Buffer")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1756 (gnus-article-mode "(gnus)The Article Buffer")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1757 (gnus-server-mode "(gnus)The Server Buffer")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1758 (gnus-browse-mode "(gnus)Browse Foreign Server")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1759 (gnus-tree-mode "(gnus)Tree Display")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1760 )
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1761 "Alist of major modes and related Info nodes.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1762
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1763 (defvar gnus-group-buffer "*Group*")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1764 (defvar gnus-summary-buffer "*Summary*")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1765 (defvar gnus-article-buffer "*Article*")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1766 (defvar gnus-server-buffer "*Server*")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1767
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1768 (defvar gnus-work-buffer " *gnus work*")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1769
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1770 (defvar gnus-original-article-buffer " *Original Article*")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1771 (defvar gnus-original-article nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1772
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1773 (defvar gnus-buffer-list nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1774 "Gnus buffers that should be killed on exit.")
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-slave nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1777 "Whether this Gnus is a slave or not.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1778
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1779 (defvar gnus-variable-list
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1780 '(gnus-newsrc-options gnus-newsrc-options-n
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1781 gnus-newsrc-last-checked-date
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1782 gnus-newsrc-alist gnus-server-alist
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1783 gnus-killed-list gnus-zombie-list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1784 gnus-topic-topology gnus-topic-alist
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1785 gnus-format-specs)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1786 "Gnus variables saved in the quick startup file.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1787
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1788 (defvar gnus-newsrc-options nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1789 "Options line in the .newsrc file.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1790
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1791 (defvar gnus-newsrc-options-n nil
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1792 "List of regexps representing groups to be subscribed/ignored unconditionally.")
13401
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-last-checked-date nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1795 "Date Gnus last asked server for new newsgroups.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1796
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1797 (defvar gnus-topic-topology nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1798 "The complete topic hierarchy.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1799
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1800 (defvar gnus-topic-alist nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1801 "The complete topic-group alist.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1802
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1803 (defvar gnus-newsrc-alist nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1804 "Assoc list of read articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1805 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
1806
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1807 (defvar gnus-newsrc-hashtb nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1808 "Hashtable of gnus-newsrc-alist.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1809
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1810 (defvar gnus-killed-list nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1811 "List of killed newsgroups.")
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-killed-hashtb nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1814 "Hash table equivalent of gnus-killed-list.")
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-zombie-list nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1817 "List of almost dead 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-description-hashtb nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1820 "Descriptions of newsgroups.")
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-list-of-killed-groups nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1823 "List of newsgroups that have recently been killed by the user.")
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-active-hashtb nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1826 "Hashtable of active articles.")
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-moderated-list nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1829 "List of moderated newsgroups.")
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-group-marked nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1832
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1833 (defvar gnus-current-startup-file nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1834 "Startup file for the current host.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1835
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1836 (defvar gnus-last-search-regexp nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1837 "Default regexp for article search command.")
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-last-shell-command nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1840 "Default shell command on article.")
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-current-select-method nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1843 "The current method for selecting a newsgroup.")
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-group-list-mode nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1846
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1847 (defvar gnus-article-internal-prepare-hook nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1848
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1849 (defvar gnus-newsgroup-name nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1850 (defvar gnus-newsgroup-begin nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1851 (defvar gnus-newsgroup-end nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1852 (defvar gnus-newsgroup-last-rmail nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1853 (defvar gnus-newsgroup-last-mail nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1854 (defvar gnus-newsgroup-last-folder nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1855 (defvar gnus-newsgroup-last-file nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1856 (defvar gnus-newsgroup-auto-expire nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1857 (defvar gnus-newsgroup-active nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1858
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1859 (defvar gnus-newsgroup-data nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1860 (defvar gnus-newsgroup-data-reverse nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1861 (defvar gnus-newsgroup-limit nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1862 (defvar gnus-newsgroup-limits nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1863
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1864 (defvar gnus-newsgroup-unreads nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1865 "List of unread articles in the current newsgroup.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1866
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1867 (defvar gnus-newsgroup-unselected nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1868 "List of unselected unread articles in the current newsgroup.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1869
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1870 (defvar gnus-newsgroup-reads nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1871 "Alist of read articles and article marks in the current newsgroup.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1872
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1873 (defvar gnus-newsgroup-expunged-tally nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1874
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1875 (defvar gnus-newsgroup-marked nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1876 "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
1877
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1878 (defvar gnus-newsgroup-killed nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1879 "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
1880
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1881 (defvar gnus-newsgroup-cached nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1882 "List of articles that come from the article cache.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1883
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1884 (defvar gnus-newsgroup-saved nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1885 "List of articles that have been saved.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1886
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1887 (defvar gnus-newsgroup-kill-headers nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1888
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1889 (defvar gnus-newsgroup-replied nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1890 "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
1891
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1892 (defvar gnus-newsgroup-expirable nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1893 "List of articles in the current newsgroup that can be expired.")
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-processable nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1896 "List of articles in the current newsgroup that can be processed.")
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-bookmarks nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1899 "List of articles in the current newsgroup that have bookmarks.")
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-dormant nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1902 "List of dormant articles in the current newsgroup.")
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-scored nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1905 "List of scored articles in the current newsgroup.")
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-headers nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1908 "List of article headers in the current newsgroup.")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1909
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1910 (defvar gnus-newsgroup-threads nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1911
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1912 (defvar gnus-newsgroup-prepared nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1913 "Whether the current group has been prepared properly.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1914
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1915 (defvar gnus-newsgroup-ancient nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1916 "List of `gnus-fetch-old-headers' articles in the current newsgroup.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1917
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1918 (defvar gnus-newsgroup-sparse nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1919
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1920 (defvar gnus-current-article nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1921 (defvar gnus-article-current nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1922 (defvar gnus-current-headers nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1923 (defvar gnus-have-all-headers nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1924 (defvar gnus-last-article nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1925 (defvar gnus-newsgroup-history nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1926 (defvar gnus-current-kill-article nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1927
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1928 ;; Save window configuration.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1929 (defvar gnus-prev-winconf nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1930
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1931 (defvar gnus-summary-mark-positions nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1932 (defvar gnus-group-mark-positions 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 (defvar gnus-reffed-article-number nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1935
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1936 ;;; 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
1937 (defvar rmail-default-rmail-file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1938
13949
4d9ed72b9a02 (gnus-cache-removable-articles): Renamed from gnus-cache-removeable-articles.
Karl Heuer <kwzh@gnu.org>
parents: 13732
diff changeset
1939 (defvar gnus-cache-removable-articles nil)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1940
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1941 (defvar gnus-dead-summary nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1942
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1943 (defconst gnus-summary-local-variables
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1944 '(gnus-newsgroup-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1945 gnus-newsgroup-begin gnus-newsgroup-end
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1946 gnus-newsgroup-last-rmail gnus-newsgroup-last-mail
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1947 gnus-newsgroup-last-folder gnus-newsgroup-last-file
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1948 gnus-newsgroup-auto-expire gnus-newsgroup-unreads
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1949 gnus-newsgroup-unselected gnus-newsgroup-marked
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1950 gnus-newsgroup-reads gnus-newsgroup-saved
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1951 gnus-newsgroup-replied gnus-newsgroup-expirable
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1952 gnus-newsgroup-processable gnus-newsgroup-killed
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1953 gnus-newsgroup-bookmarks gnus-newsgroup-dormant
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1954 gnus-newsgroup-headers gnus-newsgroup-threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1955 gnus-newsgroup-prepared gnus-summary-highlight-line-function
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1956 gnus-current-article gnus-current-headers gnus-have-all-headers
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1957 gnus-last-article gnus-article-internal-prepare-hook
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1958 gnus-newsgroup-dependencies gnus-newsgroup-selected-overlay
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1959 gnus-newsgroup-scored gnus-newsgroup-kill-headers
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1960 gnus-newsgroup-async gnus-thread-expunge-below
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1961 gnus-score-alist gnus-current-score-file gnus-summary-expunge-below
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1962 (gnus-summary-mark-below . global)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1963 gnus-newsgroup-active gnus-scores-exclude-files
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1964 gnus-newsgroup-history gnus-newsgroup-ancient
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1965 gnus-newsgroup-sparse
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1966 (gnus-newsgroup-adaptive . gnus-use-adaptive-scoring)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1967 gnus-newsgroup-adaptive-score-file
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1968 (gnus-newsgroup-expunged-tally . 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1969 gnus-cache-removable-articles gnus-newsgroup-cached
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1970 gnus-newsgroup-data gnus-newsgroup-data-reverse
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1971 gnus-newsgroup-limit gnus-newsgroup-limits)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1972 "Variables that are buffer-local to the summary buffers.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1973
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1974 (defconst gnus-bug-message
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1975 "Sending a bug report to the Gnus Towers.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1976 ========================================
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1977
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1978 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
1979 be sent to the Gnus Bug Exterminators.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1980
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1981 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
1982 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
1983 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
1984
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1985 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
1986 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
1987 and include the backtrace in your bug report.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1988
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1989 Please describe the bug in annoying, painstaking detail.
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 Thank you for your help in stamping out bugs.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1992 ")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1993
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1994 ;;; End of variables.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1995
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1996 ;; Define some autoload functions Gnus might use.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1997 (eval-and-compile
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1998
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1999 ;; This little mapcar goes through the list below and marks the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2000 ;; symbols in question as autoloaded functions.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2001 (mapcar
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2002 (lambda (package)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2003 (let ((interactive (nth 1 (memq ':interactive package))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2004 (mapcar
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2005 (lambda (function)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2006 (let (keymap)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2007 (when (consp function)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2008 (setq keymap (car (memq 'keymap function)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2009 (setq function (car function)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2010 (autoload function (car package) nil interactive keymap)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2011 (if (eq (nth 1 package) ':interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2012 (cdddr package)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2013 (cdr package)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2014 '(("metamail" metamail-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2015 ("info" Info-goto-node)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2016 ("hexl" hexl-hex-string-to-integer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2017 ("pp" pp pp-to-string pp-eval-expression)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2018 ("mail-extr" mail-extract-address-components)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2019 ("nnmail" nnmail-split-fancy nnmail-article-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2020 ("nnvirtual" nnvirtual-catchup-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2021 ("timezone" timezone-make-date-arpa-standard timezone-fix-time
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2022 timezone-make-sortable-date timezone-make-time-string)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2023 ("rmailout" rmail-output)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2024 ("rmail" rmail-insert-rmail-file-header rmail-count-new-messages
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2025 rmail-show-message)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2026 ("gnus-soup" :interactive t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2027 gnus-group-brew-soup gnus-brew-soup gnus-soup-add-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2028 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
2029 ("nnsoup" nnsoup-pack-replies)
15577
e369d2f12bc7 Load `gnus-score-mode' from "score-mode".
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15558
diff changeset
2030 ("score-mode" :interactive t gnus-score-mode)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2031 ("gnus-mh" gnus-mh-mail-setup gnus-summary-save-article-folder
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2032 gnus-Folder-save-name gnus-folder-save-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2033 ("gnus-mh" :interactive t gnus-summary-save-in-folder)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2034 ("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
2035 gnus-server-make-menu-bar gnus-article-make-menu-bar
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2036 gnus-browse-make-menu-bar gnus-highlight-selected-summary
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2037 gnus-summary-highlight-line gnus-carpal-setup-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2038 gnus-group-highlight-line
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2039 gnus-article-add-button gnus-insert-next-page-button
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2040 gnus-insert-prev-page-button gnus-visual-turn-off-edit-menu)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2041 ("gnus-vis" :interactive t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2042 gnus-article-push-button gnus-article-press-button
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2043 gnus-article-highlight gnus-article-highlight-some
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2044 gnus-article-highlight-headers gnus-article-highlight-signature
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2045 gnus-article-add-buttons gnus-article-add-buttons-to-head
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2046 gnus-article-next-button gnus-article-prev-button)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2047 ("gnus-demon" gnus-demon-add-nocem gnus-demon-add-scanmail
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2048 gnus-demon-add-disconnection gnus-demon-add-handler
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2049 gnus-demon-remove-handler)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2050 ("gnus-demon" :interactive t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2051 gnus-demon-init gnus-demon-cancel)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2052 ("gnus-salt" gnus-highlight-selected-tree gnus-possibly-generate-tree
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2053 gnus-tree-open gnus-tree-close)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2054 ("gnus-nocem" gnus-nocem-scan-groups gnus-nocem-close
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2055 gnus-nocem-unwanted-article-p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2056 ("gnus-srvr" gnus-enter-server-buffer gnus-server-set-info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2057 ("gnus-srvr" gnus-browse-foreign-server)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2058 ("gnus-cite" :interactive t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2059 gnus-article-highlight-citation gnus-article-hide-citation-maybe
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2060 gnus-article-hide-citation gnus-article-fill-cited-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2061 gnus-article-hide-citation-in-followups)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2062 ("gnus-kill" gnus-kill gnus-apply-kill-file-internal
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2063 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
2064 gnus-execute gnus-expunge)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2065 ("gnus-cache" gnus-cache-possibly-enter-article gnus-cache-save-buffers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2066 gnus-cache-possibly-remove-articles gnus-cache-request-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2067 gnus-cache-retrieve-headers gnus-cache-possibly-alter-active
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2068 gnus-cache-enter-remove-article gnus-cached-article-p
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2069 gnus-cache-open gnus-cache-close gnus-cache-update-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2070 ("gnus-cache" :interactive t gnus-jog-cache gnus-cache-enter-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2071 gnus-cache-remove-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2072 ("gnus-score" :interactive t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2073 gnus-summary-increase-score gnus-summary-lower-score
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2074 gnus-score-flush-cache gnus-score-close
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2075 gnus-score-raise-same-subject-and-select
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2076 gnus-score-raise-same-subject gnus-score-default
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2077 gnus-score-raise-thread gnus-score-lower-same-subject-and-select
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2078 gnus-score-lower-same-subject gnus-score-lower-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2079 gnus-possibly-score-headers gnus-summary-raise-score
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2080 gnus-summary-set-score gnus-summary-current-score)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2081 ("gnus-score"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2082 (gnus-summary-score-map keymap) gnus-score-save gnus-score-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2083 gnus-current-score-file-nondirectory gnus-score-adaptive
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2084 gnus-score-find-trace gnus-score-file-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2085 ("gnus-edit" :interactive t gnus-score-customize)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2086 ("gnus-topic" :interactive t gnus-topic-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2087 ("gnus-topic" gnus-topic-remove-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2088 ("gnus-salt" :interactive t gnus-pick-mode gnus-binary-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2089 ("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
2090 ("gnus-uu" :interactive t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2091 gnus-uu-digest-mail-forward gnus-uu-digest-post-forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2092 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
2093 gnus-uu-mark-by-regexp gnus-uu-mark-all
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2094 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
2095 gnus-uu-decode-uu-and-save gnus-uu-decode-unshar
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2096 gnus-uu-decode-unshar-and-save gnus-uu-decode-save
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2097 gnus-uu-decode-binhex gnus-uu-decode-uu-view
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2098 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
2099 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
2100 gnus-uu-decode-binhex-view)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2101 ("gnus-msg" (gnus-summary-send-map keymap)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2102 gnus-mail-yank-original gnus-mail-send-and-exit
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2103 gnus-article-mail gnus-new-mail gnus-mail-reply)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2104 ("gnus-msg" :interactive t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2105 gnus-group-post-news gnus-group-mail gnus-summary-post-news
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2106 gnus-summary-followup gnus-summary-followup-with-original
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2107 gnus-summary-cancel-article gnus-summary-supersede-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2108 gnus-post-news gnus-inews-news
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2109 gnus-summary-reply gnus-summary-reply-with-original
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2110 gnus-summary-mail-forward gnus-summary-mail-other-window
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2111 gnus-bug)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2112 ("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
2113 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
2114 gnus-picons-display-x-face)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2115 ("gnus-gl" bbb-login bbb-logout bbb-grouplens-group-p
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2116 gnus-grouplens-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2117 ("smiley" :interactive t gnus-smiley-display)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2118 ("gnus-vm" gnus-vm-mail-setup)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2119 ("gnus-vm" :interactive t gnus-summary-save-in-vm
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2120 gnus-summary-save-article-vm))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2121
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2122
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2123
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2124 ;; Fix by Hallvard B Furuseth <h.b.furuseth@usit.uio.no>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2125 ;; 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
2126 ;; functions in some startup hook to whatever you want.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2127 (defalias 'gnus-summary-position-point 'gnus-goto-colon)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2128 (defalias 'gnus-group-position-point 'gnus-goto-colon)
13401
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 ;;; Various macros and substs.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2131
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2132 (defun gnus-header-from (header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2133 (mail-header-from header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2134
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2135 (defmacro gnus-eval-in-buffer-window (buffer &rest forms)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2136 "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
2137 (let ((tempvar (make-symbol "GnusStartBufferWindow"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2138 (w (make-symbol "w"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2139 (buf (make-symbol "buf")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2140 `(let* ((,tempvar (selected-window))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2141 (,buf ,buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2142 (,w (get-buffer-window ,buf 'visible)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2143 (unwind-protect
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2144 (progn
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2145 (if ,w
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2146 (select-window ,w)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2147 (pop-to-buffer ,buf))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2148 ,@forms)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2149 (select-window ,tempvar)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2150
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2151 (put 'gnus-eval-in-buffer-window 'lisp-indent-function 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2152 (put 'gnus-eval-in-buffer-window 'lisp-indent-hook 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2153 (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
2154
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2155 (defmacro gnus-gethash (string hashtable)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2156 "Get hash value of STRING in HASHTABLE."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2157 `(symbol-value (intern-soft ,string ,hashtable)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2158
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2159 (defmacro gnus-sethash (string value hashtable)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2160 "Set hash value. Arguments are STRING, VALUE, and HASHTABLE."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2161 `(set (intern ,string ,hashtable) ,value))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2162
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2163 (defmacro gnus-intern-safe (string hashtable)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2164 "Set hash value. Arguments are STRING, VALUE, and HASHTABLE."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2165 `(let ((symbol (intern ,string ,hashtable)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2166 (or (boundp symbol)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2167 (set symbol nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2168 symbol))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2169
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2170 (defmacro gnus-group-unread (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2171 "Get the currently computed number of unread articles in GROUP."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2172 `(car (gnus-gethash ,group gnus-newsrc-hashtb)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2173
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2174 (defmacro gnus-group-entry (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2175 "Get the newsrc entry for GROUP."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2176 `(gnus-gethash ,group gnus-newsrc-hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2177
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2178 (defmacro gnus-active (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2179 "Get active info on GROUP."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2180 `(gnus-gethash ,group gnus-active-hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2181
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2182 (defmacro gnus-set-active (group active)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2183 "Set GROUP's active info."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2184 `(gnus-sethash ,group ,active gnus-active-hashtb))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2185
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2186 ;; modified by MORIOKA Tomohiko <morioka@jaist.ac.jp>
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2187 ;; function `substring' might cut on a middle of multi-octet
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2188 ;; character.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2189 (defun gnus-truncate-string (str width)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2190 (substring str 0 width))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2191
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2192 ;; 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
2193 ;; 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
2194 ;; `(substr "abc" 0 30)' pukes with "Args out of range".
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2195 (defsubst gnus-limit-string (str width)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2196 (if (> (length str) width)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2197 (substring str 0 width)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2198 str))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2199
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2200 (defsubst gnus-simplify-subject-re (subject)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2201 "Remove \"Re:\" from subject lines."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2202 (if (string-match "^[Rr][Ee]: *" subject)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2203 (substring subject (match-end 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2204 subject))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2205
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2206 (defsubst gnus-functionp (form)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2207 "Return non-nil if FORM is funcallable."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2208 (or (and (symbolp form) (fboundp form))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2209 (and (listp form) (eq (car form) 'lambda))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2210
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2211 (defsubst gnus-goto-char (point)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2212 (and point (goto-char point)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2213
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2214 (defmacro gnus-buffer-exists-p (buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2215 `(let ((buffer ,buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2216 (and buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2217 (funcall (if (stringp buffer) 'get-buffer 'buffer-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2218 buffer))))
13401
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-kill-buffer (buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2221 `(let ((buf ,buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2222 (if (gnus-buffer-exists-p buf)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2223 (kill-buffer buf))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2224
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2225 (defsubst gnus-point-at-bol ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2226 "Return point at the beginning of the line."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2227 (let ((p (point)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2228 (beginning-of-line)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2229 (prog1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2230 (point)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2231 (goto-char p))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2232
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2233 (defsubst gnus-point-at-eol ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2234 "Return point at the end of the line."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2235 (let ((p (point)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2236 (end-of-line)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2237 (prog1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2238 (point)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2239 (goto-char p))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2240
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2241 (defun gnus-alive-p ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2242 "Say whether Gnus is running or not."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2243 (and gnus-group-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2244 (get-buffer gnus-group-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2245
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2246 (defun gnus-delete-first (elt list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2247 "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
2248 (if (equal (car list) elt)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2249 (cdr list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2250 (let ((total list))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2251 (while (and (cdr list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2252 (not (equal (cadr list) elt)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2253 (setq list (cdr list)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2254 (when (cdr list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2255 (setcdr list (cddr list)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2256 total)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2257
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2258 ;; Delete the current line (and the next N lines.);
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2259 (defmacro gnus-delete-line (&optional n)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2260 `(delete-region (progn (beginning-of-line) (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2261 (progn (forward-line ,(or n 1)) (point))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2262
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2263 ;; Suggested by Brian Edmonds <edmonds@cs.ubc.ca>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2264 (defvar gnus-init-inhibit nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2265 (defun gnus-read-init-file (&optional inhibit-next)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2266 (if gnus-init-inhibit
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2267 (setq gnus-init-inhibit nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2268 (setq gnus-init-inhibit inhibit-next)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2269 (and gnus-init-file
16645
52eb67172ca0 (gnus-read-init-file): Don't load anything if init-file-user is nil.
Richard M. Stallman <rms@gnu.org>
parents: 16023
diff changeset
2270 ;; Don't load .gnus if -q option was used.
52eb67172ca0 (gnus-read-init-file): Don't load anything if init-file-user is nil.
Richard M. Stallman <rms@gnu.org>
parents: 16023
diff changeset
2271 init-file-user
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2272 (or (and (file-exists-p gnus-init-file)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2273 ;; Don't try to load a directory.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2274 (not (file-directory-p gnus-init-file)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2275 (file-exists-p (concat gnus-init-file ".el"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2276 (file-exists-p (concat gnus-init-file ".elc")))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2277 (condition-case var
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2278 (load gnus-init-file nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2279 (error
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2280 (error "Error in %s: %s" gnus-init-file var))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2281
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2282 ;; Info access macros.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2283
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2284 (defmacro gnus-info-group (info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2285 `(nth 0 ,info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2286 (defmacro gnus-info-rank (info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2287 `(nth 1 ,info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2288 (defmacro gnus-info-read (info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2289 `(nth 2 ,info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2290 (defmacro gnus-info-marks (info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2291 `(nth 3 ,info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2292 (defmacro gnus-info-method (info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2293 `(nth 4 ,info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2294 (defmacro gnus-info-params (info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2295 `(nth 5 ,info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2296
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2297 (defmacro gnus-info-level (info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2298 `(let ((rank (gnus-info-rank ,info)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2299 (if (consp rank)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2300 (car rank)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2301 rank)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2302 (defmacro gnus-info-score (info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2303 `(let ((rank (gnus-info-rank ,info)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2304 (or (and (consp rank) (cdr rank)) 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2305
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2306 (defmacro gnus-info-set-group (info group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2307 `(setcar ,info ,group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2308 (defmacro gnus-info-set-rank (info rank)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2309 `(setcar (nthcdr 1 ,info) ,rank))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2310 (defmacro gnus-info-set-read (info read)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2311 `(setcar (nthcdr 2 ,info) ,read))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2312 (defmacro gnus-info-set-marks (info marks)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2313 `(setcar (nthcdr 3 ,info) ,marks))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2314 (defmacro gnus-info-set-method (info method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2315 `(setcar (nthcdr 4 ,info) ,method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2316 (defmacro gnus-info-set-params (info params)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2317 `(setcar (nthcdr 5 ,info) ,params))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2318
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2319 (defmacro gnus-info-set-level (info level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2320 `(let ((rank (cdr ,info)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2321 (if (consp (car rank))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2322 (setcar (car rank) ,level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2323 (setcar rank ,level))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2324 (defmacro gnus-info-set-score (info score)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2325 `(let ((rank (cdr ,info)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2326 (if (consp (car rank))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2327 (setcdr (car rank) ,score)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2328 (setcar rank (cons (car rank) ,score)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2329
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2330 (defmacro gnus-get-info (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2331 `(nth 2 (gnus-gethash ,group gnus-newsrc-hashtb)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2332
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2333 (defun gnus-byte-code (func)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2334 "Return a form that can be `eval'ed based on FUNC."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2335 (let ((fval (symbol-function func)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2336 (if (byte-code-function-p fval)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2337 (let ((flist (append fval nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2338 (setcar flist 'byte-code)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2339 flist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2340 (cons 'progn (cddr fval)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2341
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2342 ;; Find out whether the gnus-visual TYPE is wanted.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2343 (defun gnus-visual-p (&optional type class)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2344 (and gnus-visual ; Has to be non-nil, at least.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2345 (if (not type) ; We don't care about type.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2346 gnus-visual
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2347 (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
2348 (or (memq type gnus-visual)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2349 (memq class gnus-visual))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2350 t))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2351
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2352 ;;; Load the compatability functions.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2353
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2354 (require 'gnus-cus)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2355 (require 'gnus-ems)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2356
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 ;;;
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2359 ;;; Shutdown
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2360 ;;;
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2361
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2362 (defvar gnus-shutdown-alist nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2363
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2364 (defun gnus-add-shutdown (function &rest symbols)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2365 "Run FUNCTION whenever one of SYMBOLS is shut down."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2366 (push (cons function symbols) gnus-shutdown-alist))
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-shutdown (symbol)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2369 "Shut down everything that waits for SYMBOL."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2370 (let ((alist gnus-shutdown-alist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2371 entry)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2372 (while (setq entry (pop alist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2373 (when (memq symbol (cdr entry))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2374 (funcall (car entry))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2375
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2376
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2377
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2378 ;; Format specs. The chunks below are the machine-generated forms
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2379 ;; 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
2380 ;; 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
2381 ;; default actions will be quite fast, while still retaining the full
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2382 ;; flexibility of the user-defined format specs.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2383
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2384 ;; 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
2385 ;; are really dynamic variables.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2386
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2387 (defvar gnus-tmp-unread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2388 (defvar gnus-tmp-replied)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2389 (defvar gnus-tmp-score-char)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2390 (defvar gnus-tmp-indentation)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2391 (defvar gnus-tmp-opening-bracket)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2392 (defvar gnus-tmp-lines)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2393 (defvar gnus-tmp-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2394 (defvar gnus-tmp-closing-bracket)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2395 (defvar gnus-tmp-subject-or-nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2396 (defvar gnus-tmp-subject)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2397 (defvar gnus-tmp-marked)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2398 (defvar gnus-tmp-marked-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2399 (defvar gnus-tmp-subscribed)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2400 (defvar gnus-tmp-process-marked)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2401 (defvar gnus-tmp-number-of-unread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2402 (defvar gnus-tmp-group-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2403 (defvar gnus-tmp-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2404 (defvar gnus-tmp-article-number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2405 (defvar gnus-tmp-unread-and-unselected)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2406 (defvar gnus-tmp-news-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2407 (defvar gnus-tmp-news-server)
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-mouse-face)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2410 (defvar gnus-mouse-face-prop)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2411
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2412 (defun gnus-summary-line-format-spec ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2413 (insert gnus-tmp-unread gnus-tmp-replied
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2414 gnus-tmp-score-char gnus-tmp-indentation)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2415 (gnus-put-text-property
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2416 (point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2417 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2418 (insert
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2419 gnus-tmp-opening-bracket
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2420 (format "%4d: %-20s"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2421 gnus-tmp-lines
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2422 (if (> (length gnus-tmp-name) 20)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2423 (substring gnus-tmp-name 0 20)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2424 gnus-tmp-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2425 gnus-tmp-closing-bracket)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2426 (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2427 gnus-mouse-face-prop gnus-mouse-face)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2428 (insert " " gnus-tmp-subject-or-nil "\n"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2429
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2430 (defvar gnus-summary-line-format-spec
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2431 (gnus-byte-code 'gnus-summary-line-format-spec))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2432
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2433 (defun gnus-summary-dummy-line-format-spec ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2434 (insert "* ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2435 (gnus-put-text-property
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2436 (point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2437 (progn
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 (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2440 gnus-mouse-face-prop gnus-mouse-face)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2441 (insert " " gnus-tmp-subject "\n"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2442
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2443 (defvar gnus-summary-dummy-line-format-spec
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2444 (gnus-byte-code 'gnus-summary-dummy-line-format-spec))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2445
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2446 (defun gnus-group-line-format-spec ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2447 (insert gnus-tmp-marked-mark gnus-tmp-subscribed
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2448 gnus-tmp-process-marked
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2449 gnus-group-indentation
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2450 (format "%5s: " gnus-tmp-number-of-unread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2451 (gnus-put-text-property
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2452 (point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2453 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2454 (insert gnus-tmp-group "\n")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2455 (1- (point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2456 gnus-mouse-face-prop gnus-mouse-face))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2457 (defvar gnus-group-line-format-spec
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2458 (gnus-byte-code 'gnus-group-line-format-spec))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2459
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2460 (defvar gnus-format-specs
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2461 `((version . ,emacs-version)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2462 (group ,gnus-group-line-format ,gnus-group-line-format-spec)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2463 (summary-dummy ,gnus-summary-dummy-line-format
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2464 ,gnus-summary-dummy-line-format-spec)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2465 (summary ,gnus-summary-line-format ,gnus-summary-line-format-spec)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2466
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2467 (defvar gnus-article-mode-line-format-spec nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2468 (defvar gnus-summary-mode-line-format-spec nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2469 (defvar gnus-group-mode-line-format-spec nil)
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 ;;; Phew. All that gruft is over, fortunately.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2472
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2473
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2474 ;;;
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2475 ;;; Gnus Utility Functions
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2476 ;;;
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2477
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2478 (defun gnus-extract-address-components (from)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2479 (let (name address)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2480 ;; 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
2481 ;; 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
2482 ;; the time in news messages.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2483 (if (string-match "\\b[^@ \t<>]+[!@][^@ \t<>]+\\b" from)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2484 (setq address (substring from (match-beginning 0) (match-end 0))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2485 ;; Then we check whether the "name <address>" format is used.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2486 (and address
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2487 ;; Fix by MORIOKA Tomohiko <morioka@jaist.ac.jp>
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2488 ;; Linear white space is not required.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2489 (string-match (concat "[ \t]*<" (regexp-quote address) ">") from)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2490 (and (setq name (substring from 0 (match-beginning 0)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2491 ;; Strip any quotes from the name.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2492 (string-match "\".*\"" name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2493 (setq name (substring name 1 (1- (match-end 0))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2494 ;; If not, then "address (name)" is used.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2495 (or name
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2496 (and (string-match "(.+)" from)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2497 (setq name (substring from (1+ (match-beginning 0))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2498 (1- (match-end 0)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2499 (and (string-match "()" from)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2500 (setq name address))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2501 ;; Fix by MORIOKA Tomohiko <morioka@jaist.ac.jp>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2502 ;; XOVER might not support folded From headers.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2503 (and (string-match "(.*" from)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2504 (setq name (substring from (1+ (match-beginning 0))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2505 (match-end 0)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2506 ;; Fix by Hallvard B Furuseth <h.b.furuseth@usit.uio.no>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2507 (list (or name from) (or address from))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2508
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2509 (defun gnus-fetch-field (field)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2510 "Return the value of the header FIELD of current article."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2511 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2512 (save-restriction
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2513 (let ((case-fold-search t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2514 (inhibit-point-motion-hooks t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2515 (nnheader-narrow-to-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2516 (message-fetch-field field)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2517
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2518 (defun gnus-goto-colon ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2519 (beginning-of-line)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2520 (search-forward ":" (gnus-point-at-eol) t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2521
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2522 ;;;###autoload
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2523 (defun gnus-update-format (var)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2524 "Update the format specification near point."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2525 (interactive
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2526 (list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2527 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2528 (eval-defun nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2529 ;; Find the end of the current word.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2530 (re-search-forward "[ \t\n]" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2531 ;; Search backward.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2532 (when (re-search-backward "\\(gnus-[-a-z]+-line-format\\)" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2533 (match-string 1)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2534 (let* ((type (intern (progn (string-match "gnus-\\([-a-z]+\\)-line" var)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2535 (match-string 1 var))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2536 (entry (assq type gnus-format-specs))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2537 value spec)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2538 (when entry
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2539 (setq gnus-format-specs (delq entry gnus-format-specs)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2540 (set
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2541 (intern (format "%s-spec" var))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2542 (gnus-parse-format (setq value (symbol-value (intern var)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2543 (symbol-value (intern (format "%s-alist" var)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2544 (not (string-match "mode" var))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2545 (setq spec (symbol-value (intern (format "%s-spec" var))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2546 (push (list type value spec) gnus-format-specs)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2547
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2548 (pop-to-buffer "*Gnus Format*")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2549 (erase-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2550 (lisp-interaction-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2551 (insert (pp-to-string spec))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2552
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2553 (defun gnus-update-format-specifications (&optional force)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2554 "Update all (necessary) format specifications."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2555 ;; Make the indentation array.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2556 (gnus-make-thread-indent-array)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2557
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2558 ;; See whether all the stored info needs to be flushed.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2559 (when (or force
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2560 (not (equal emacs-version
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2561 (cdr (assq 'version gnus-format-specs)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2562 (setq gnus-format-specs nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2563
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2564 ;; Go through all the formats and see whether they need updating.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2565 (let ((types '(summary summary-dummy group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2566 summary-mode group-mode article-mode))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2567 new-format entry type val)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2568 (while (setq type (pop types))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2569 ;; Jump to the proper buffer to find out the value of
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2570 ;; the variable, if possible. (It may be buffer-local.)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2571 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2572 (let ((buffer (intern (format "gnus-%s-buffer" type)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2573 val)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2574 (when (and (boundp buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2575 (setq val (symbol-value buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2576 (get-buffer val)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2577 (buffer-name (get-buffer val)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2578 (set-buffer (get-buffer val)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2579 (setq new-format (symbol-value
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2580 (intern (format "gnus-%s-line-format" type))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2581 (setq entry (cdr (assq type gnus-format-specs)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2582 (if (and entry
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2583 (equal (car entry) new-format))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2584 ;; Use the old format.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2585 (set (intern (format "gnus-%s-line-format-spec" type))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2586 (cadr entry))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2587 ;; This is a new format.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2588 (setq val
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2589 (if (not (stringp new-format))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2590 ;; This is a function call or something.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2591 new-format
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2592 ;; This is a "real" format.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2593 (gnus-parse-format
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2594 new-format
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2595 (symbol-value
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2596 (intern (format "gnus-%s-line-format-alist"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2597 (if (eq type 'article-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2598 'summary-mode type))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2599 (not (string-match "mode$" (symbol-name type))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2600 ;; Enter the new format spec into the list.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2601 (if entry
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2602 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2603 (setcar (cdr entry) val)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2604 (setcar entry new-format))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2605 (push (list type new-format val) gnus-format-specs))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2606 (set (intern (format "gnus-%s-line-format-spec" type)) val))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2607
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2608 (unless (assq 'version gnus-format-specs)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2609 (push (cons 'version emacs-version) gnus-format-specs))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2610
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2611 (gnus-update-group-mark-positions)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2612 (gnus-update-summary-mark-positions))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2613
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2614 (defun gnus-update-summary-mark-positions ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2615 "Compute where the summary marks are to go."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2616 (save-excursion
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2617 (when (and gnus-summary-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2618 (get-buffer gnus-summary-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2619 (buffer-name (get-buffer gnus-summary-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2620 (set-buffer gnus-summary-buffer))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2621 (let ((gnus-replied-mark 129)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2622 (gnus-score-below-mark 130)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2623 (gnus-score-over-mark 130)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2624 (thread nil)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2625 (gnus-visual nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2626 (spec gnus-summary-line-format-spec)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2627 pos)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2628 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2629 (gnus-set-work-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2630 (let ((gnus-summary-line-format-spec spec))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2631 (gnus-summary-insert-line
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2632 [0 "" "" "" "" "" 0 0 ""] 0 nil 128 t nil "" nil 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2633 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2634 (setq pos (list (cons 'unread (and (search-forward "\200" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2635 (- (point) 2)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2636 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2637 (push (cons 'replied (and (search-forward "\201" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2638 (- (point) 2)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2639 pos)
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 'score (and (search-forward "\202" nil t) (- (point) 2)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2642 pos)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2643 (setq gnus-summary-mark-positions pos))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2644
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2645 (defun gnus-update-group-mark-positions ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2646 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2647 (let ((gnus-process-mark 128)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2648 (gnus-group-marked '("dummy.group"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2649 (gnus-active-hashtb (make-vector 10 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2650 (gnus-set-active "dummy.group" '(0 . 0))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2651 (gnus-set-work-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2652 (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
2653 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2654 (setq gnus-group-mark-positions
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2655 (list (cons 'process (and (search-forward "\200" nil t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2656 (- (point) 2))))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2657
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2658 (defvar gnus-mouse-face-0 'highlight)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2659 (defvar gnus-mouse-face-1 'highlight)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2660 (defvar gnus-mouse-face-2 'highlight)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2661 (defvar gnus-mouse-face-3 'highlight)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2662 (defvar gnus-mouse-face-4 'highlight)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2663
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2664 (defun gnus-mouse-face-function (form type)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2665 `(gnus-put-text-property
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2666 (point) (progn ,@form (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2667 gnus-mouse-face-prop
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2668 ,(if (equal type 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2669 'gnus-mouse-face
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2670 `(quote ,(symbol-value (intern (format "gnus-mouse-face-%d" type)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2671
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2672 (defvar gnus-face-0 'bold)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2673 (defvar gnus-face-1 'italic)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2674 (defvar gnus-face-2 'bold-italic)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2675 (defvar gnus-face-3 'bold)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2676 (defvar gnus-face-4 'bold)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2677
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2678 (defun gnus-face-face-function (form type)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2679 `(gnus-put-text-property
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2680 (point) (progn ,@form (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2681 'face ',(symbol-value (intern (format "gnus-face-%d" type)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2682
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2683 (defun gnus-max-width-function (el max-width)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2684 (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
2685 (if (symbolp el)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2686 `(if (> (length ,el) ,max-width)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2687 (substring ,el 0 ,max-width)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2688 ,el)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2689 `(let ((val (eval ,el)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2690 (if (numberp val)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2691 (setq val (int-to-string val)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2692 (if (> (length val) ,max-width)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2693 (substring val 0 ,max-width)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2694 val))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2695
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2696 (defun gnus-parse-format (format spec-alist &optional insert)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2697 ;; This function parses the FORMAT string with the help of the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2698 ;; 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
2699 ;; string. If the FORMAT string contains the specifiers %( and %)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2700 ;; 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
2701 (if (string-match
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2702 "\\`\\(.*\\)%[0-9]?[{(]\\(.*\\)%[0-9]?[})]\\(.*\n?\\)\\'"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2703 format)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2704 (gnus-parse-complex-format format spec-alist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2705 ;; This is a simple format.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2706 (gnus-parse-simple-format format spec-alist insert)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2707
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2708 (defun gnus-parse-complex-format (format spec-alist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2709 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2710 (gnus-set-work-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2711 (insert format)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2712 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2713 (while (re-search-forward "\"" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2714 (replace-match "\\\"" nil t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2715 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2716 (insert "(\"")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2717 (while (re-search-forward "%\\([0-9]+\\)?\\([{}()]\\)" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2718 (let ((number (if (match-beginning 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2719 (match-string 1) "0"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2720 (delim (aref (match-string 2) 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2721 (if (or (= delim ?\() (= delim ?\{))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2722 (replace-match (concat "\"(" (if (= delim ?\() "mouse" "face")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2723 " " number " \""))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2724 (replace-match "\")\""))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2725 (goto-char (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2726 (insert "\")")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2727 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2728 (let ((form (read (current-buffer))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2729 (cons 'progn (gnus-complex-form-to-spec form spec-alist)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2730
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2731 (defun gnus-complex-form-to-spec (form spec-alist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2732 (delq nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2733 (mapcar
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2734 (lambda (sform)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2735 (if (stringp sform)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2736 (gnus-parse-simple-format sform spec-alist t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2737 (funcall (intern (format "gnus-%s-face-function" (car sform)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2738 (gnus-complex-form-to-spec (cddr sform) spec-alist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2739 (nth 1 sform))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2740 form)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2741
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2742 (defun gnus-parse-simple-format (format spec-alist &optional insert)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2743 ;; 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
2744 ;; 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
2745 ;; string.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2746 (let ((max-width 0)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2747 spec flist fstring newspec elem beg result dontinsert)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2748 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2749 (gnus-set-work-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2750 (insert format)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2751 (goto-char (point-min))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2752 (while (re-search-forward "%[-0-9]*\\(,[0-9]+\\)?\\([^0-9]\\)\\(.\\)?"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2753 nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2754 (if (= (setq spec (string-to-char (match-string 2))) ?%)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2755 (setq newspec "%"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2756 beg (1+ (match-beginning 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2757 ;; First check if there are any specs that look anything like
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2758 ;; "%12,12A", ie. with a "max width specification". These have
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2759 ;; to be treated specially.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2760 (if (setq beg (match-beginning 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2761 (setq max-width
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2762 (string-to-int
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2763 (buffer-substring
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2764 (1+ (match-beginning 1)) (match-end 1))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2765 (setq max-width 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2766 (setq beg (match-beginning 2)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2767 ;; Find the specification from `spec-alist'.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2768 (unless (setq elem (cdr (assq spec spec-alist)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2769 (setq elem '("*" ?s)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2770 ;; Treat user defined format specifiers specially.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2771 (when (eq (car elem) 'gnus-tmp-user-defined)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2772 (setq elem
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2773 (list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2774 (list (intern (concat "gnus-user-format-function-"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2775 (match-string 3)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2776 'gnus-tmp-header) ?s))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2777 (delete-region (match-beginning 3) (match-end 3)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2778 (if (not (zerop max-width))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2779 (let ((el (car elem)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2780 (cond ((= (cadr elem) ?c)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2781 (setq el (list 'char-to-string el)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2782 ((= (cadr elem) ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2783 (setq el (list 'int-to-string el))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2784 (setq flist (cons (gnus-max-width-function el max-width)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2785 flist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2786 (setq newspec ?s))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2787 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2788 (setq flist (cons (car elem) flist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2789 (setq newspec (cadr elem)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2790 ;; Remove the old specification (and possibly a ",12" string).
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2791 (delete-region beg (match-end 2))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2792 ;; Insert the new specification.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2793 (goto-char beg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2794 (insert newspec))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2795 (setq fstring (buffer-substring 1 (point-max))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2796 ;; Do some postprocessing to increase efficiency.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2797 (setq
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2798 result
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2799 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2800 ;; Emptyness.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2801 ((string= fstring "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2802 nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2803 ;; Not a format string.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2804 ((not (string-match "%" fstring))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2805 (list fstring))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2806 ;; A format string with just a single string spec.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2807 ((string= fstring "%s")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2808 (list (car flist)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2809 ;; A single character.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2810 ((string= fstring "%c")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2811 (list (car flist)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2812 ;; A single number.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2813 ((string= fstring "%d")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2814 (setq dontinsert)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2815 (if insert
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2816 (list `(princ ,(car flist)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2817 (list `(int-to-string ,(car flist)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2818 ;; Just lots of chars and strings.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2819 ((string-match "\\`\\(%[cs]\\)+\\'" fstring)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2820 (nreverse flist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2821 ;; A single string spec at the beginning of the spec.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2822 ((string-match "\\`%[sc][^%]+\\'" fstring)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2823 (list (car flist) (substring fstring 2)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2824 ;; A single string spec in the middle of the spec.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2825 ((string-match "\\`\\([^%]+\\)%[sc]\\([^%]+\\)\\'" fstring)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2826 (list (match-string 1 fstring) (car flist) (match-string 2 fstring)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2827 ;; A single string spec in the end of the spec.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2828 ((string-match "\\`\\([^%]+\\)%[sc]\\'" fstring)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2829 (list (match-string 1 fstring) (car flist)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2830 ;; A more complex spec.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2831 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2832 (list (cons 'format (cons fstring (nreverse flist)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2833
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2834 (if insert
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2835 (when result
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2836 (if dontinsert
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2837 result
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2838 (cons 'insert result)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2839 (cond ((stringp result)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2840 result)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2841 ((consp result)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2842 (cons 'concat result))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2843 (t "")))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2844
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2845 (defun gnus-eval-format (format &optional alist props)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2846 "Eval the format variable FORMAT, using ALIST.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2847 If PROPS, insert the result."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2848 (let ((form (gnus-parse-format format alist props)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2849 (if props
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2850 (gnus-add-text-properties (point) (progn (eval form) (point)) props)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2851 (eval form))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2852
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2853 (defun gnus-remove-text-with-property (prop)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2854 "Delete all text in the current buffer with text property PROP."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2855 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2856 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2857 (while (not (eobp))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2858 (while (get-text-property (point) prop)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2859 (delete-char 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2860 (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
2861
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2862 (defun gnus-set-work-buffer ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2863 (if (get-buffer gnus-work-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2864 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2865 (set-buffer gnus-work-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2866 (erase-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2867 (set-buffer (get-buffer-create gnus-work-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2868 (kill-all-local-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2869 (buffer-disable-undo (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2870 (gnus-add-current-to-buffer-list)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2871
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2872 ;; Article file names when saving.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2873
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2874 (defun gnus-Numeric-save-name (newsgroup headers &optional last-file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2875 "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2876 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
2877 Otherwise, it is like ~/News/news/group/num."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2878 (let ((default
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2879 (expand-file-name
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2880 (concat (if (gnus-use-long-file-name 'not-save)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2881 (gnus-capitalize-newsgroup newsgroup)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2882 (gnus-newsgroup-directory-form newsgroup))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2883 "/" (int-to-string (mail-header-number headers)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2884 gnus-article-save-directory)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2885 (if (and last-file
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2886 (string-equal (file-name-directory default)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2887 (file-name-directory last-file))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2888 (string-match "^[0-9]+$" (file-name-nondirectory last-file)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2889 default
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2890 (or last-file default))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2891
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2892 (defun gnus-numeric-save-name (newsgroup headers &optional last-file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2893 "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2894 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
2895 ~/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
2896 (let ((default
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2897 (expand-file-name
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2898 (concat (if (gnus-use-long-file-name 'not-save)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2899 newsgroup
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2900 (gnus-newsgroup-directory-form newsgroup))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2901 "/" (int-to-string (mail-header-number headers)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2902 gnus-article-save-directory)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2903 (if (and last-file
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2904 (string-equal (file-name-directory default)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2905 (file-name-directory last-file))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2906 (string-match "^[0-9]+$" (file-name-nondirectory last-file)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2907 default
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2908 (or last-file default))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2909
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2910 (defun gnus-Plain-save-name (newsgroup headers &optional last-file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2911 "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2912 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
2913 ~/News/News.group. Otherwise, it is like ~/News/news/group/news."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2914 (or last-file
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2915 (expand-file-name
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2916 (if (gnus-use-long-file-name 'not-save)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2917 (gnus-capitalize-newsgroup newsgroup)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2918 (concat (gnus-newsgroup-directory-form newsgroup) "/news"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2919 gnus-article-save-directory)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2920
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2921 (defun gnus-plain-save-name (newsgroup headers &optional last-file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2922 "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2923 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
2924 ~/News/news.group. Otherwise, it is like ~/News/news/group/news."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2925 (or last-file
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2926 (expand-file-name
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2927 (if (gnus-use-long-file-name 'not-save)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2928 newsgroup
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2929 (concat (gnus-newsgroup-directory-form newsgroup) "/news"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2930 gnus-article-save-directory)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2931
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2932 ;; For subscribing new newsgroup
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2933
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2934 (defun gnus-subscribe-hierarchical-interactive (groups)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2935 (let ((groups (sort groups 'string<))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2936 prefixes prefix start ans group starts)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2937 (while groups
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2938 (setq prefixes (list "^"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2939 (while (and groups prefixes)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2940 (while (not (string-match (car prefixes) (car groups)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2941 (setq prefixes (cdr prefixes)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2942 (setq prefix (car prefixes))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2943 (setq start (1- (length prefix)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2944 (if (and (string-match "[^\\.]\\." (car groups) start)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2945 (cdr groups)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2946 (setq prefix
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2947 (concat "^" (substring (car groups) 0 (match-end 0))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2948 (string-match prefix (cadr groups)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2949 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2950 (setq prefixes (cons prefix prefixes))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2951 (message "Descend hierarchy %s? ([y]nsq): "
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2952 (substring prefix 1 (1- (length prefix))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2953 (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
2954 (ding)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2955 (message "Descend hierarchy %s? ([y]nsq): "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2956 (substring prefix 1 (1- (length prefix)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2957 (cond ((= ans ?n)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2958 (while (and groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2959 (string-match prefix
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2960 (setq group (car groups))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2961 (setq gnus-killed-list
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2962 (cons group gnus-killed-list))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2963 (gnus-sethash group group gnus-killed-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2964 (setq groups (cdr groups)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2965 (setq starts (cdr starts)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2966 ((= ans ?s)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2967 (while (and groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2968 (string-match prefix
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2969 (setq group (car groups))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2970 (gnus-sethash group group gnus-killed-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2971 (gnus-subscribe-alphabetically (car groups))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2972 (setq groups (cdr groups)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2973 (setq starts (cdr starts)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2974 ((= ans ?q)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2975 (while groups
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2976 (setq group (car groups))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2977 (setq gnus-killed-list (cons group gnus-killed-list))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2978 (gnus-sethash group group gnus-killed-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2979 (setq groups (cdr groups))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2980 (t nil)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2981 (message "Subscribe %s? ([n]yq)" (car groups))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2982 (while (not (memq (setq ans (read-char)) '(?y ?\n ?q ?n)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2983 (ding)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2984 (message "Subscribe %s? ([n]yq)" (car groups)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2985 (setq group (car groups))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2986 (cond ((= ans ?y)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2987 (gnus-subscribe-alphabetically (car groups))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2988 (gnus-sethash group group gnus-killed-hashtb))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2989 ((= ans ?q)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2990 (while groups
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2991 (setq group (car groups))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2992 (setq gnus-killed-list (cons group gnus-killed-list))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2993 (gnus-sethash group group gnus-killed-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2994 (setq groups (cdr groups))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2995 (t
13401
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)))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2999
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3000 (defun gnus-subscribe-randomly (newsgroup)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3001 "Subscribe new NEWSGROUP by making it the first newsgroup."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3002 (gnus-subscribe-newsgroup newsgroup))
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-alphabetically (newgroup)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3005 "Subscribe new NEWSGROUP and insert it in alphabetical order."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3006 (let ((groups (cdr gnus-newsrc-alist))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3007 before)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3008 (while (and (not before) groups)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3009 (if (string< newgroup (caar groups))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3010 (setq before (caar groups))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3011 (setq groups (cdr groups))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3012 (gnus-subscribe-newsgroup newgroup before)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3013
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3014 (defun gnus-subscribe-hierarchically (newgroup)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3015 "Subscribe new NEWSGROUP and insert it in hierarchical newsgroup order."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3016 ;; Basic ideas by mike-w@cs.aukuni.ac.nz (Mike Williams)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3017 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3018 (set-buffer (find-file-noselect gnus-current-startup-file))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3019 (let ((groupkey newgroup)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3020 before)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3021 (while (and (not before) groupkey)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3022 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3023 (let ((groupkey-re
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3024 (concat "^\\(" (regexp-quote groupkey) ".*\\)[!:]")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3025 (while (and (re-search-forward groupkey-re nil t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3026 (progn
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3027 (setq before (match-string 1))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3028 (string< before newgroup)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3029 ;; Remove tail of newsgroup name (eg. a.b.c -> a.b)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3030 (setq groupkey
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3031 (if (string-match "^\\(.*\\)\\.[^.]+$" groupkey)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3032 (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
3033 (gnus-subscribe-newsgroup newgroup before))
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
3034 (kill-buffer (current-buffer))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3035
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3036 (defun gnus-subscribe-interactively (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3037 "Subscribe the new GROUP interactively.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3038 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
3039 it is killed."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3040 (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
3041 (gnus-subscribe-hierarchically group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3042 (push group gnus-killed-list)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3043
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3044 (defun gnus-subscribe-zombies (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3045 "Make the new GROUP into a zombie group."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3046 (push group gnus-zombie-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-killed (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3049 "Make the new GROUP a killed group."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3050 (push group gnus-killed-list))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3051
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3052 (defun gnus-subscribe-newsgroup (newsgroup &optional next)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3053 "Subscribe new NEWSGROUP.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3054 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
3055 the first newsgroup."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3056 ;; We subscribe the group by changing its level to `subscribed'.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3057 (gnus-group-change-level
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3058 newsgroup gnus-level-default-subscribed
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3059 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
3060 (gnus-message 5 "Subscribe newsgroup: %s" newsgroup))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3061
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3062 ;; For directories
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3063
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3064 (defun gnus-newsgroup-directory-form (newsgroup)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3065 "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
3066 (let ((newsgroup (gnus-newsgroup-savable-name newsgroup))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3067 (len (length newsgroup))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3068 idx)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3069 ;; 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
3070 ;; entire name.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3071 (if (setq idx (string-match ":" newsgroup))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3072 (aset newsgroup idx ?/)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3073 (setq idx 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3074 ;; Replace all occurrences of `.' with `/'.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3075 (while (< idx len)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3076 (if (= (aref newsgroup idx) ?.)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3077 (aset newsgroup idx ?/))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3078 (setq idx (1+ idx)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3079 newsgroup))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3080
13949
4d9ed72b9a02 (gnus-cache-removable-articles): Renamed from gnus-cache-removeable-articles.
Karl Heuer <kwzh@gnu.org>
parents: 13732
diff changeset
3081 (defun gnus-newsgroup-savable-name (group)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3082 ;; 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
3083 ;; with dots.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3084 (nnheader-replace-chars-in-string group ?/ ?.))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3085
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3086 (defun gnus-make-directory (dir)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3087 "Make DIRECTORY recursively."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3088 ;; 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
3089 ;; of the many mysteries of the universe.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3090 (let* ((dir (expand-file-name dir default-directory))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3091 dirs err)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3092 (if (string-match "/$" dir)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3093 (setq dir (substring dir 0 (match-beginning 0))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3094 ;; 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
3095 (while (not (file-exists-p dir))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3096 (setq dirs (cons dir dirs))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3097 (string-match "/[^/]+$" dir)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3098 (setq dir (substring dir 0 (match-beginning 0))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3099 ;; Then create all the subdirs.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3100 (while (and dirs (not err))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3101 (condition-case ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3102 (make-directory (car dirs))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3103 (error (setq err t)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3104 (setq dirs (cdr dirs)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3105 ;; We return whether we were successful or not.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3106 (not dirs)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3107
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3108 (defun gnus-capitalize-newsgroup (newsgroup)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3109 "Capitalize NEWSGROUP name."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3110 (and (not (zerop (length newsgroup)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3111 (concat (char-to-string (upcase (aref newsgroup 0)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3112 (substring newsgroup 1))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3113
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3114 ;; Various... things.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3115
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3116 (defun gnus-simplify-subject (subject &optional re-only)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3117 "Remove `Re:' and words in parentheses.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3118 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
3119 (let ((case-fold-search t)) ;Ignore case.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3120 ;; Remove `Re:', `Re^N:', `Re(n)', and `Re[n]:'.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3121 (when (string-match "\\`\\(re\\([[(^][0-9]+[])]?\\)?:[ \t]*\\)+" subject)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3122 (setq subject (substring subject (match-end 0))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3123 ;; Remove uninteresting prefixes.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3124 (if (and (not re-only)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3125 gnus-simplify-ignored-prefixes
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3126 (string-match gnus-simplify-ignored-prefixes subject))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3127 (setq subject (substring subject (match-end 0))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3128 ;; Remove words in parentheses from end.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3129 (unless re-only
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3130 (while (string-match "[ \t\n]*([^()]*)[ \t\n]*\\'" subject)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3131 (setq subject (substring subject 0 (match-beginning 0)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3132 ;; Return subject string.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3133 subject))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3134
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3135 ;; Remove any leading "re:"s, any trailing paren phrases, and simplify
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3136 ;; all whitespace.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3137 ;; Written by Stainless Steel Rat <ratinox@ccs.neu.edu>.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3138 (defun gnus-simplify-buffer-fuzzy ()
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3139 (let ((case-fold-search t))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3140 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3141 (while (search-forward "\t" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3142 (replace-match " " t t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3143 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3144 (re-search-forward "^ *\\(re\\|fwd\\)[[{(^0-9]*[])}]?[:;] *" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3145 (goto-char (match-beginning 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3146 (while (or
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3147 (looking-at "^ *\\(re\\|fwd\\)[[{(^0-9]*[])}]?[:;] *")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3148 (looking-at "^[[].*: .*[]]$"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3149 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3150 (while (re-search-forward "^ *\\(re\\|fwd\\)[[{(^0-9]*[])}]?[:;] *"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3151 nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3152 (replace-match "" t t))
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 "^[[].*: .*[]]$" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3155 (goto-char (match-end 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3156 (delete-char -1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3157 (delete-region
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3158 (progn (goto-char (match-beginning 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3159 (re-search-forward ":"))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3160 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3161 (while (re-search-forward " *[[{(][^()\n]*[]})] *$" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3162 (replace-match "" t t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3163 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3164 (while (re-search-forward " +" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3165 (replace-match " " t t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3166 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3167 (while (re-search-forward " $" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3168 (replace-match "" t t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3169 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3170 (while (re-search-forward "^ +" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3171 (replace-match "" t t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3172 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3173 (when gnus-simplify-subject-fuzzy-regexp
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3174 (if (listp gnus-simplify-subject-fuzzy-regexp)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3175 (let ((list gnus-simplify-subject-fuzzy-regexp))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3176 (while list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3177 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3178 (while (re-search-forward (car list) nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3179 (replace-match "" t t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3180 (setq list (cdr list))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3181 (while (re-search-forward gnus-simplify-subject-fuzzy-regexp nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3182 (replace-match "" t t))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3183
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3184 (defun gnus-simplify-subject-fuzzy (subject)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3185 "Siplify a subject string fuzzily."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3186 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3187 (gnus-set-work-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3188 (let ((case-fold-search t))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3189 (insert subject)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3190 (inline (gnus-simplify-buffer-fuzzy))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3191 (buffer-string))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3192
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3193 ;; 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
3194 (defun gnus-add-current-to-buffer-list ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3195 (or (memq (current-buffer) gnus-buffer-list)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3196 (setq gnus-buffer-list (cons (current-buffer) gnus-buffer-list))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3197
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3198 (defun gnus-string> (s1 s2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3199 (not (or (string< s1 s2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3200 (string= s1 s2))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3201
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3202 (defun gnus-read-active-file-p ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3203 "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
3204 (memq gnus-select-method gnus-have-read-active-file))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3205
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3206 ;;; General various misc type functions.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3207
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3208 (defun gnus-clear-system ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3209 "Clear all variables and buffers."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3210 ;; Clear Gnus variables.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3211 (let ((variables gnus-variable-list))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3212 (while variables
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3213 (set (car variables) nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3214 (setq variables (cdr variables))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3215 ;; Clear other internal variables.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3216 (setq gnus-list-of-killed-groups nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3217 gnus-have-read-active-file nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3218 gnus-newsrc-alist nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3219 gnus-newsrc-hashtb nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3220 gnus-killed-list nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3221 gnus-zombie-list nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3222 gnus-killed-hashtb nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3223 gnus-active-hashtb nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3224 gnus-moderated-list nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3225 gnus-description-hashtb nil
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3226 gnus-current-headers nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3227 gnus-thread-indent-array nil
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3228 gnus-newsgroup-headers nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3229 gnus-newsgroup-name nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3230 gnus-server-alist nil
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3231 gnus-group-list-mode nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3232 gnus-opened-servers nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3233 gnus-group-mark-positions nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3234 gnus-newsgroup-data nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3235 gnus-newsgroup-unreads nil
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
3236 nnoo-state-alist nil
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3237 gnus-current-select-method nil)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3238 (gnus-shutdown 'gnus)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3239 ;; Kill the startup file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3240 (and gnus-current-startup-file
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3241 (get-file-buffer gnus-current-startup-file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3242 (kill-buffer (get-file-buffer gnus-current-startup-file)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3243 ;; Clear the dribble buffer.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3244 (gnus-dribble-clear)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3245 ;; Kill global KILL file buffer.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3246 (when (get-file-buffer (gnus-newsgroup-kill-file nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3247 (kill-buffer (get-file-buffer (gnus-newsgroup-kill-file nil))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3248 (gnus-kill-buffer nntp-server-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3249 ;; Kill Gnus buffers.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3250 (while gnus-buffer-list
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3251 (gnus-kill-buffer (pop gnus-buffer-list)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3252 ;; Remove Gnus frames.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3253 (gnus-kill-gnus-frames))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3254
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3255 (defun gnus-kill-gnus-frames ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3256 "Kill all frames Gnus has created."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3257 (while gnus-created-frames
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3258 (when (frame-live-p (car gnus-created-frames))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3259 ;; We slap a condition-case around this `delete-frame' to ensure
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3260 ;; 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
3261 (condition-case ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3262 (delete-frame (car gnus-created-frames))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3263 (error nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3264 (pop gnus-created-frames)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3265
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3266 (defun gnus-windows-old-to-new (setting)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3267 ;; 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
3268 (when (symbolp setting)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3269 (setq setting
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3270 ;; Take care of ooold GNUS 3.x values.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3271 (cond ((eq setting 'SelectArticle) 'article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3272 ((memq setting '(SelectSubject ExpandSubject)) 'summary)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3273 ((memq setting '(SelectNewsgroup ExitNewsgroup)) 'group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3274 (t setting))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3275 (if (or (listp setting)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3276 (not (and gnus-window-configuration
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3277 (memq setting '(group summary article)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3278 setting
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3279 (let* ((setting (if (eq setting 'group)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3280 (if (assq 'newsgroup gnus-window-configuration)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3281 'newsgroup
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3282 'newsgroups) setting))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3283 (elem (cadr (assq setting gnus-window-configuration)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3284 (total (apply '+ elem))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3285 (types '(group summary article))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3286 (pbuf (if (eq setting 'newsgroups) 'group 'summary))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3287 (i 0)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3288 perc
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3289 out)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3290 (while (< i 3)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3291 (or (not (numberp (nth i elem)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3292 (zerop (nth i elem))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3293 (progn
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3294 (setq perc (if (= i 2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3295 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3296 (/ (float (nth 0 elem)) total)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3297 (setq out (cons (if (eq pbuf (nth i types))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3298 (list (nth i types) perc 'point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3299 (list (nth i types) perc))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3300 out))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3301 (setq i (1+ i)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3302 `(vertical 1.0 ,@(nreverse out)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3303
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3304 ;;;###autoload
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3305 (defun gnus-add-configuration (conf)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3306 "Add the window configuration CONF to `gnus-buffer-configuration'."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3307 (setq gnus-buffer-configuration
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3308 (cons conf (delq (assq (car conf) gnus-buffer-configuration)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3309 gnus-buffer-configuration))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3310
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3311 (defvar gnus-frame-list nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3312
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3313 (defun gnus-configure-frame (split &optional window)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3314 "Split WINDOW according to SPLIT."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3315 (unless window
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3316 (setq window (get-buffer-window (current-buffer))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3317 (select-window window)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3318 ;; This might be an old-stylee buffer config.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3319 (when (vectorp split)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3320 (setq split (append split nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3321 (when (or (consp (car split))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3322 (vectorp (car split)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3323 (push 1.0 split)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3324 (push 'vertical split))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3325 ;; The SPLIT might be something that is to be evaled to
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3326 ;; return a new SPLIT.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3327 (while (and (not (assq (car split) gnus-window-to-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3328 (gnus-functionp (car split)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3329 (setq split (eval split)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3330 (let* ((type (car split))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3331 (subs (cddr split))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3332 (len (if (eq type 'horizontal) (window-width) (window-height)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3333 (total 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3334 (window-min-width (or gnus-window-min-width window-min-width))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3335 (window-min-height (or gnus-window-min-height window-min-height))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3336 s result new-win rest comp-subs size sub)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3337 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3338 ;; Nothing to do here.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3339 ((null split))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3340 ;; Don't switch buffers.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3341 ((null type)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3342 (and (memq 'point split) window))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3343 ;; This is a buffer to be selected.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3344 ((not (memq type '(frame horizontal vertical)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3345 (let ((buffer (cond ((stringp type) type)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3346 (t (cdr (assq type gnus-window-to-buffer)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3347 buf)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3348 (unless buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3349 (error "Illegal buffer type: %s" type))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3350 (unless (setq buf (get-buffer (if (symbolp buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3351 (symbol-value buffer) buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3352 (setq buf (get-buffer-create (if (symbolp buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3353 (symbol-value buffer) buffer))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3354 (switch-to-buffer buf)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3355 ;; We return the window if it has the `point' spec.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3356 (and (memq 'point split) window)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3357 ;; This is a frame split.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3358 ((eq type 'frame)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3359 (unless gnus-frame-list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3360 (setq gnus-frame-list (list (window-frame
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3361 (get-buffer-window (current-buffer))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3362 (let ((i 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3363 params frame fresult)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3364 (while (< i (length subs))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3365 ;; Frame parameter is gotten from the sub-split.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3366 (setq params (cadr (elt subs i)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3367 ;; It should be a list.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3368 (unless (listp params)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3369 (setq params nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3370 ;; Create a new frame?
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3371 (unless (setq frame (elt gnus-frame-list i))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3372 (nconc gnus-frame-list (list (setq frame (make-frame params))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3373 (push frame gnus-created-frames))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3374 ;; Is the old frame still alive?
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3375 (unless (frame-live-p frame)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3376 (setcar (nthcdr i gnus-frame-list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3377 (setq frame (make-frame params))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3378 ;; Select the frame in question and do more splits there.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3379 (select-frame frame)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3380 (setq fresult (or (gnus-configure-frame (elt subs i)) fresult))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3381 (incf i))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3382 ;; Select the frame that has the selected buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3383 (when fresult
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3384 (select-frame (window-frame fresult)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3385 ;; This is a normal split.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3386 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3387 (when (> (length subs) 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3388 ;; First we have to compute the sizes of all new windows.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3389 (while subs
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3390 (setq sub (append (pop subs) nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3391 (while (and (not (assq (car sub) gnus-window-to-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3392 (gnus-functionp (car sub)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3393 (setq sub (eval sub)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3394 (when sub
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3395 (push sub comp-subs)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3396 (setq size (cadar comp-subs))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3397 (cond ((equal size 1.0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3398 (setq rest (car comp-subs))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3399 (setq s 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3400 ((floatp size)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3401 (setq s (floor (* size len))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3402 ((integerp size)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3403 (setq s size))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3404 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3405 (error "Illegal size: %s" size)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3406 ;; Try to make sure that we are inside the safe limits.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3407 (cond ((zerop s))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3408 ((eq type 'horizontal)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3409 (setq s (max s window-min-width)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3410 ((eq type 'vertical)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3411 (setq s (max s window-min-height))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3412 (setcar (cdar comp-subs) s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3413 (incf total s)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3414 ;; Take care of the "1.0" spec.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3415 (if rest
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3416 (setcar (cdr rest) (- len total))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3417 (error "No 1.0 specs in %s" split))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3418 ;; The we do the actual splitting in a nice recursive
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3419 ;; fashion.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3420 (setq comp-subs (nreverse comp-subs))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3421 (while comp-subs
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3422 (if (null (cdr comp-subs))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3423 (setq new-win window)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3424 (setq new-win
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3425 (split-window window (cadar comp-subs)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3426 (eq type 'horizontal))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3427 (setq result (or (gnus-configure-frame
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3428 (car comp-subs) window) result))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3429 (select-window new-win)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3430 (setq window new-win)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3431 (setq comp-subs (cdr comp-subs))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3432 ;; Return the proper window, if any.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3433 (when result
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3434 (select-window result))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3435
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3436 (defvar gnus-frame-split-p nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3437
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3438 (defun gnus-configure-windows (setting &optional force)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3439 (setq setting (gnus-windows-old-to-new setting))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3440 (let ((split (if (symbolp setting)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3441 (cadr (assq setting gnus-buffer-configuration))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3442 setting))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3443 all-visible)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3444
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3445 (setq gnus-frame-split-p nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3446
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3447 (unless split
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3448 (error "No such setting: %s" setting))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3449
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3450 (if (and (setq all-visible (gnus-all-windows-visible-p split))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3451 (not force))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3452 ;; All the windows mentioned are already visible, so we just
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3453 ;; 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
3454 ;; winconf.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3455 (select-window all-visible)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3456
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3457 ;; Either remove all windows or just remove all Gnus windows.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3458 (let ((frame (selected-frame)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3459 (unwind-protect
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3460 (if gnus-use-full-window
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3461 ;; We want to remove all other windows.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3462 (if (not gnus-frame-split-p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3463 ;; This is not a `frame' split, so we ignore the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3464 ;; other frames.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3465 (delete-other-windows)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3466 ;; This is a `frame' split, so we delete all windows
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3467 ;; on all frames.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3468 (mapcar
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3469 (lambda (frame)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3470 (unless (eq (cdr (assq 'minibuffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3471 (frame-parameters frame)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3472 'only)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3473 (select-frame frame)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3474 (delete-other-windows)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3475 (frame-list)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3476 ;; Just remove some windows.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3477 (gnus-remove-some-windows)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3478 (switch-to-buffer nntp-server-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3479 (select-frame frame)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3480
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3481 (switch-to-buffer nntp-server-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3482 (gnus-configure-frame split (get-buffer-window (current-buffer))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3483
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3484 (defun gnus-all-windows-visible-p (split)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3485 "Say whether all buffers in SPLIT are currently visible.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3486 In particular, the value returned will be the window that
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3487 should have point."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3488 (let ((stack (list split))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3489 (all-visible t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3490 type buffer win buf)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3491 (while (and (setq split (pop stack))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3492 all-visible)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3493 ;; Be backwards compatible.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3494 (when (vectorp split)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3495 (setq split (append split nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3496 (when (or (consp (car split))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3497 (vectorp (car split)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3498 (push 1.0 split)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3499 (push 'vertical split))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3500 ;; The SPLIT might be something that is to be evaled to
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3501 ;; return a new SPLIT.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3502 (while (and (not (assq (car split) gnus-window-to-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3503 (gnus-functionp (car split)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3504 (setq split (eval split)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3505
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3506 (setq type (elt split 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3507 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3508 ;; Nothing here.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3509 ((null split) t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3510 ;; A buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3511 ((not (memq type '(horizontal vertical frame)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3512 (setq buffer (cond ((stringp type) type)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3513 (t (cdr (assq type gnus-window-to-buffer)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3514 (unless buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3515 (error "Illegal buffer type: %s" type))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3516 (when (setq buf (get-buffer (if (symbolp buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3517 (symbol-value buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3518 buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3519 (setq win (get-buffer-window buf t)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3520 (if win
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3521 (when (memq 'point split)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3522 (setq all-visible win))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3523 (setq all-visible nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3524 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3525 (when (eq type 'frame)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3526 (setq gnus-frame-split-p t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3527 (setq stack (append (cddr split) stack)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3528 (unless (eq all-visible t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3529 all-visible)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3530
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3531 (defun gnus-window-top-edge (&optional window)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3532 (nth 1 (window-edges window)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3533
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3534 (defun gnus-remove-some-windows ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3535 (let ((buffers gnus-window-to-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3536 buf bufs lowest-buf lowest)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3537 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3538 ;; Remove windows on all known Gnus buffers.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3539 (while buffers
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3540 (setq buf (cdar buffers))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3541 (if (symbolp buf)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3542 (setq buf (and (boundp buf) (symbol-value buf))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3543 (and buf
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3544 (get-buffer-window buf)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3545 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3546 (setq bufs (cons buf bufs))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3547 (pop-to-buffer buf)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3548 (if (or (not lowest)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3549 (< (gnus-window-top-edge) lowest))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3550 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3551 (setq lowest (gnus-window-top-edge))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3552 (setq lowest-buf buf)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3553 (setq buffers (cdr buffers)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3554 ;; Remove windows on *all* summary buffers.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3555 (walk-windows
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3556 (lambda (win)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3557 (let ((buf (window-buffer win)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3558 (if (string-match "^\\*Summary" (buffer-name buf))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3559 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3560 (setq bufs (cons buf bufs))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3561 (pop-to-buffer buf)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3562 (if (or (not lowest)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3563 (< (gnus-window-top-edge) lowest))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3564 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3565 (setq lowest-buf buf)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3566 (setq lowest (gnus-window-top-edge)))))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3567 (and lowest-buf
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3568 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3569 (pop-to-buffer lowest-buf)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3570 (switch-to-buffer nntp-server-buffer)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3571 (while bufs
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3572 (and (not (eq (car bufs) lowest-buf))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3573 (delete-windows-on (car bufs)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3574 (setq bufs (cdr bufs))))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3575
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3576 (defun gnus-version (&optional arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3577 "Version number of this version of Gnus.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3578 If ARG, insert string at point."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3579 (interactive "P")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3580 (let ((methods gnus-valid-select-methods)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3581 (mess gnus-version)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3582 meth)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3583 ;; 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
3584 ;; 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
3585 ;; currently in use will have their message numbers taken into
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3586 ;; consideration.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3587 (while methods
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3588 (setq meth (intern (concat (caar methods) "-version")))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3589 (and (boundp meth)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3590 (stringp (symbol-value meth))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3591 (setq mess (concat mess "; " (symbol-value meth))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3592 (setq methods (cdr methods)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3593 (if arg
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3594 (insert (message mess))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3595 (message mess))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3596
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3597 (defun gnus-info-find-node ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3598 "Find Info documentation of Gnus."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3599 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3600 ;; Enlarge info window if needed.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3601 (let ((mode major-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3602 gnus-info-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3603 (Info-goto-node (cadr (assq mode gnus-info-nodes)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3604 (setq gnus-info-buffer (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3605 (gnus-configure-windows 'info)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3606
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3607 (defun gnus-days-between (date1 date2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3608 ;; Return the number of days between date1 and date2.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3609 (- (gnus-day-number date1) (gnus-day-number date2)))
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-day-number (date)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3612 (let ((dat (mapcar (lambda (s) (and s (string-to-int s)) )
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3613 (timezone-parse-date date))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3614 (timezone-absolute-from-gregorian
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3615 (nth 1 dat) (nth 2 dat) (car dat))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3616
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3617 (defun gnus-encode-date (date)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3618 "Convert DATE to internal time."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3619 (let* ((parse (timezone-parse-date date))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3620 (date (mapcar (lambda (d) (and d (string-to-int d))) parse))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3621 (time (mapcar 'string-to-int (timezone-parse-time (aref parse 3)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3622 (encode-time (caddr time) (cadr time) (car time)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3623 (caddr date) (cadr date) (car date) (nth 4 date))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3624
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3625 (defun gnus-time-minus (t1 t2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3626 "Subtract two internal times."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3627 (let ((borrow (< (cadr t1) (cadr t2))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3628 (list (- (car t1) (car t2) (if borrow 1 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3629 (- (+ (if borrow 65536 0) (cadr t1)) (cadr t2)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3630
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3631 (defun gnus-file-newer-than (file date)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3632 (let ((fdate (nth 5 (file-attributes file))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3633 (or (> (car fdate) (car date))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3634 (and (= (car fdate) (car date))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3635 (> (nth 1 fdate) (nth 1 date))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3636
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3637 (defmacro gnus-local-set-keys (&rest plist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3638 "Set the keys in PLIST in the current keymap."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3639 `(gnus-define-keys-1 (current-local-map) ',plist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3640
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3641 (defmacro gnus-define-keys (keymap &rest plist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3642 "Define all keys in PLIST in KEYMAP."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3643 `(gnus-define-keys-1 (quote ,keymap) (quote ,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 (put 'gnus-define-keys 'lisp-indent-function 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3646 (put 'gnus-define-keys 'lisp-indent-hook 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3647 (put 'gnus-define-keymap 'lisp-indent-function 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3648 (put 'gnus-define-keymap 'lisp-indent-hook 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3649
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3650 (defmacro gnus-define-keymap (keymap &rest plist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3651 "Define all keys in PLIST in KEYMAP."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3652 `(gnus-define-keys-1 ,keymap (quote ,plist)))
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 (defun gnus-define-keys-1 (keymap plist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3655 (when (null keymap)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3656 (error "Can't set keys in a null keymap"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3657 (cond ((symbolp keymap)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3658 (setq keymap (symbol-value keymap)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3659 ((keymapp keymap))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3660 ((listp keymap)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3661 (set (car keymap) nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3662 (define-prefix-command (car keymap))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3663 (define-key (symbol-value (caddr keymap)) (cadr keymap) (car keymap))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3664 (setq keymap (symbol-value (car keymap)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3665 (let (key)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3666 (while plist
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3667 (when (symbolp (setq key (pop plist)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3668 (setq key (symbol-value key)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3669 (define-key keymap key (pop plist)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3670
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3671 (defun gnus-group-read-only-p (&optional group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3672 "Check whether GROUP supports editing or not.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3673 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
3674 that that variable is buffer-local to the summary buffers."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3675 (let ((group (or group gnus-newsgroup-name)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3676 (not (gnus-check-backend-function 'request-replace-article group))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3677
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3678 (defun gnus-group-total-expirable-p (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3679 "Check whether GROUP is total-expirable or not."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3680 (let ((params (gnus-info-params (gnus-get-info group))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3681 (or (memq 'total-expire params)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3682 (cdr (assq 'total-expire params)) ; (total-expire . t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3683 (and gnus-total-expirable-newsgroups ; Check var.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3684 (string-match gnus-total-expirable-newsgroups group)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3685
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3686 (defun gnus-group-auto-expirable-p (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3687 "Check whether GROUP is total-expirable or not."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3688 (let ((params (gnus-info-params (gnus-get-info group))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3689 (or (memq 'auto-expire params)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3690 (cdr (assq 'auto-expire params)) ; (auto-expire . t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3691 (and gnus-auto-expirable-newsgroups ; Check var.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3692 (string-match gnus-auto-expirable-newsgroups group)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3693
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3694 (defun gnus-virtual-group-p (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3695 "Say whether GROUP is virtual or not."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3696 (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
3697 gnus-valid-select-methods)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3698
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3699 (defun gnus-news-group-p (group &optional article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3700 "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
3701 (or (gnus-member-of-valid 'post group) ; Ordinary news group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3702 (and (gnus-member-of-valid 'post-mail group) ; Combined group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3703 (eq (gnus-request-type group article) 'news))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3704
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3705 (defsubst gnus-simplify-subject-fully (subject)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3706 "Simplify a subject string according to the user's wishes."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3707 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3708 ((null gnus-summary-gather-subject-limit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3709 (gnus-simplify-subject-re subject))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3710 ((eq gnus-summary-gather-subject-limit 'fuzzy)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3711 (gnus-simplify-subject-fuzzy subject))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3712 ((numberp gnus-summary-gather-subject-limit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3713 (gnus-limit-string (gnus-simplify-subject-re subject)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3714 gnus-summary-gather-subject-limit))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3715 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3716 subject)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3717
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3718 (defsubst gnus-subject-equal (s1 s2 &optional simple-first)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3719 "Check whether two subjects are equal. If optional argument
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3720 simple-first is t, first argument is already simplified."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3721 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3722 ((null simple-first)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3723 (equal (gnus-simplify-subject-fully s1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3724 (gnus-simplify-subject-fully s2)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3725 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3726 (equal s1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3727 (gnus-simplify-subject-fully s2)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3728
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3729 ;; Returns a list of writable groups.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3730 (defun gnus-writable-groups ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3731 (let ((alist gnus-newsrc-alist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3732 groups group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3733 (while (setq group (car (pop alist)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3734 (unless (gnus-group-read-only-p group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3735 (push group groups)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3736 (nreverse groups)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3737
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3738 (defun gnus-completing-read (default prompt &rest args)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3739 ;; Like `completing-read', except that DEFAULT is the default argument.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3740 (let* ((prompt (if default
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3741 (concat prompt " (default " default ") ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3742 (concat prompt " ")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3743 (answer (apply 'completing-read prompt args)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3744 (if (or (null answer) (zerop (length answer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3745 default
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3746 answer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3747
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3748 ;; 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
3749 ;; the echo area.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3750 (defun gnus-y-or-n-p (prompt)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3751 (prog1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3752 (y-or-n-p prompt)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3753 (message "")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3754
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3755 (defun gnus-yes-or-no-p (prompt)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3756 (prog1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3757 (yes-or-no-p prompt)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3758 (message "")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3759
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3760 ;; Check whether to use long file names.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3761 (defun gnus-use-long-file-name (symbol)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3762 ;; The variable has to be set...
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3763 (and gnus-use-long-file-name
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3764 ;; If it isn't a list, then we return t.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3765 (or (not (listp gnus-use-long-file-name))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3766 ;; 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
3767 ;; return nil.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3768 (not (memq symbol gnus-use-long-file-name)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3769
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3770 ;; 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
3771 ;; it yet. -erik selberg@cs.washington.edu
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3772 (defun gnus-dd-mmm (messy-date)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3773 "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
3774 (let ((datevec (condition-case () (timezone-parse-date messy-date)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3775 (error nil))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3776 (if (not datevec)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3777 "??-???"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3778 (format "%2s-%s"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3779 (condition-case ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3780 ;; Make sure leading zeroes are stripped.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3781 (number-to-string (string-to-number (aref datevec 2)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3782 (error "??"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3783 (capitalize
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3784 (or (car
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3785 (nth (1- (string-to-number (aref datevec 1)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3786 timezone-months-assoc))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3787 "???"))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3788
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3789 (defun gnus-mode-string-quote (string)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3790 "Quote all \"%\" in STRING."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3791 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3792 (gnus-set-work-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3793 (insert string)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3794 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3795 (while (search-forward "%" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3796 (insert "%"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3797 (buffer-string)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3798
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3799 ;; Make a hash table (default and minimum size is 255).
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3800 ;; Optional argument HASHSIZE specifies the table size.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3801 (defun gnus-make-hashtable (&optional hashsize)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3802 (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
3803
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3804 ;; 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
3805 ;; less than 2^x.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3806 (defun gnus-create-hash-size (min)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3807 (let ((i 1))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3808 (while (< i min)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3809 (setq i (* 2 i)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3810 (1- i)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3811
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3812 ;; Show message if message has a lower level than `gnus-verbose'.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3813 ;; Guideline for numbers:
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3814 ;; 1 - error messages, 3 - non-serious error messages, 5 - messages
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3815 ;; 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
3816 ;; on stuff, 9 - messages inside loops.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3817 (defun gnus-message (level &rest args)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3818 (if (<= level gnus-verbose)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3819 (apply 'message args)
13949
4d9ed72b9a02 (gnus-cache-removable-articles): Renamed from gnus-cache-removeable-articles.
Karl Heuer <kwzh@gnu.org>
parents: 13732
diff changeset
3820 ;; 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
3821 ;; 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
3822 ;; from `message'.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3823 (apply 'format args)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3824
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3825 (defun gnus-error (level &rest args)
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
3826 "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
3827 (when (<= (floor level) gnus-verbose)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3828 (apply 'message args)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3829 (ding)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3830 (let (duration)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3831 (when (and (floatp level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3832 (not (zerop (setq duration (* 10 (- level (floor level)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3833 (sit-for duration))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3834 nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3835
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3836 ;; Generate a unique new group name.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3837 (defun gnus-generate-new-group-name (leaf)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3838 (let ((name leaf)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3839 (num 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3840 (while (gnus-gethash name gnus-newsrc-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3841 (setq name (concat leaf "<" (int-to-string (setq num (1+ num))) ">")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3842 name))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3843
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3844 (defsubst gnus-hide-text (b e props)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3845 "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
3846 (gnus-add-text-properties b e props)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3847 (when (memq 'intangible props)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3848 (gnus-put-text-property (max (1- b) (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3849 b 'intangible (cddr (memq 'intangible props)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3850
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3851 (defsubst gnus-unhide-text (b e)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3852 "Remove hidden text properties from region between B and E."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3853 (remove-text-properties b e gnus-hidden-properties)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3854 (when (memq 'intangible gnus-hidden-properties)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3855 (gnus-put-text-property (max (1- b) (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3856 b 'intangible nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3857
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3858 (defun gnus-hide-text-type (b e type)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3859 "Hide text of TYPE between B and E."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3860 (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
3861
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3862 (defun gnus-parent-headers (headers &optional generation)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3863 "Return the headers of the GENERATIONeth parent of HEADERS."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3864 (unless generation
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3865 (setq generation 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3866 (let (references parent)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3867 (while (and headers (not (zerop generation)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3868 (setq references (mail-header-references headers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3869 (when (and references
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3870 (setq parent (gnus-parent-id references))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3871 (setq headers (car (gnus-id-to-thread parent))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3872 (decf generation)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3873 headers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3874
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3875 (defun gnus-parent-id (references)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3876 "Return the last Message-ID in REFERENCES."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3877 (when (and references
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3878 (string-match "\\(<[^\n<>]+>\\)[ \t\n]*\\'" references))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3879 (substring references (match-beginning 1) (match-end 1))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3880
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3881 (defun gnus-split-references (references)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3882 "Return a list of Message-IDs in REFERENCES."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3883 (let ((beg 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3884 ids)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3885 (while (string-match "<[^>]+>" references beg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3886 (push (substring references (match-beginning 0) (setq beg (match-end 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3887 ids))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3888 (nreverse ids)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3889
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3890 (defun gnus-buffer-live-p (buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3891 "Say whether BUFFER is alive or not."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3892 (and buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3893 (get-buffer buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3894 (buffer-name (get-buffer buffer))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3895
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3896 (defun gnus-ephemeral-group-p (group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3897 "Say whether GROUP is ephemeral or not."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3898 (gnus-group-get-parameter group 'quit-config))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3899
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3900 (defun gnus-group-quit-config (group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3901 "Return the quit-config of GROUP."
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
13700
7cbb1453aefd (gnus-simplify-mode-line): New function to simplify the
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 13699
diff changeset
3904 (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
3905 "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
3906 (setq mode-line-modified "-- ")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3907 (when (listp mode-line-format)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3908 (make-local-variable 'mode-line-format)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3909 (setq mode-line-format (copy-sequence mode-line-format))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3910 (when (equal (nth 3 mode-line-format) " ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3911 (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
3912
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3913 ;;; List and range functions
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3914
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3915 (defun gnus-last-element (list)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3916 "Return last element of LIST."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3917 (while (cdr list)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3918 (setq list (cdr list)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3919 (car list))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3920
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3921 (defun gnus-copy-sequence (list)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3922 "Do a complete, total copy of a list."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3923 (if (and (consp list) (not (consp (cdr list))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3924 (cons (car list) (cdr list))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3925 (mapcar (lambda (elem) (if (consp elem)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3926 (if (consp (cdr elem))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3927 (gnus-copy-sequence elem)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3928 (cons (car elem) (cdr elem)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3929 elem))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3930 list)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3931
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3932 (defun gnus-set-difference (list1 list2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3933 "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
3934 (let ((list1 (copy-sequence list1)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3935 (while list2
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3936 (setq list1 (delq (car list2) list1))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3937 (setq list2 (cdr list2)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3938 list1))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3939
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3940 (defun gnus-sorted-complement (list1 list2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3941 "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
3942 Both lists have to be sorted over <."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3943 (let (out)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3944 (if (or (null list1) (null list2))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3945 (or list1 list2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3946 (while (and list1 list2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3947 (cond ((= (car list1) (car list2))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3948 (setq list1 (cdr list1)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3949 list2 (cdr list2)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3950 ((< (car list1) (car list2))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3951 (setq out (cons (car list1) out))
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 (t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3954 (setq out (cons (car list2) out))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3955 (setq list2 (cdr list2)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3956 (nconc (nreverse out) (or list1 list2)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3957
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3958 (defun gnus-intersection (list1 list2)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3959 (let ((result nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3960 (while list2
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3961 (if (memq (car list2) list1)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3962 (setq result (cons (car list2) result)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3963 (setq list2 (cdr list2)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3964 result))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3965
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3966 (defun gnus-sorted-intersection (list1 list2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3967 ;; LIST1 and LIST2 have to be sorted over <.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3968 (let (out)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3969 (while (and list1 list2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3970 (cond ((= (car list1) (car list2))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3971 (setq out (cons (car list1) out)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3972 list1 (cdr list1)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3973 list2 (cdr list2)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3974 ((< (car list1) (car list2))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3975 (setq list1 (cdr list1)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3976 (t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3977 (setq list2 (cdr list2)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3978 (nreverse out)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3979
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3980 (defun gnus-set-sorted-intersection (list1 list2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3981 ;; LIST1 and LIST2 have to be sorted over <.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3982 ;; This function modifies LIST1.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3983 (let* ((top (cons nil list1))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3984 (prev top))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3985 (while (and list1 list2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3986 (cond ((= (car list1) (car list2))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3987 (setq prev list1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3988 list1 (cdr list1)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3989 list2 (cdr list2)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3990 ((< (car list1) (car list2))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3991 (setcdr prev (cdr list1))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3992 (setq list1 (cdr list1)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3993 (t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3994 (setq list2 (cdr list2)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3995 (setcdr prev nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3996 (cdr top)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3997
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3998 (defun gnus-compress-sequence (numbers &optional always-list)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3999 "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
4000 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
4001 ranges."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4002 (let* ((first (car numbers))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4003 (last (car numbers))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4004 result)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4005 (if (null numbers)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4006 nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4007 (if (not (listp (cdr numbers)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4008 numbers
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4009 (while numbers
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4010 (cond ((= last (car numbers)) nil) ;Omit duplicated number
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4011 ((= (1+ last) (car numbers)) ;Still in sequence
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4012 (setq last (car numbers)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4013 (t ;End of one sequence
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4014 (setq result
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4015 (cons (if (= first last) first
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4016 (cons first last)) result))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4017 (setq first (car numbers))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4018 (setq last (car numbers))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4019 (setq numbers (cdr numbers)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4020 (if (and (not always-list) (null result))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4021 (if (= first last) (list first) (cons first last))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4022 (nreverse (cons (if (= first last) first (cons first last))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4023 result)))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4024
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4025 (defalias 'gnus-uncompress-sequence 'gnus-uncompress-range)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4026 (defun gnus-uncompress-range (ranges)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4027 "Expand a list of ranges into a list of numbers.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4028 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
4029 these ranges."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4030 (let (first last result)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4031 (cond
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4032 ((null ranges)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4033 nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4034 ((not (listp (cdr ranges)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4035 (setq first (car ranges))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4036 (setq last (cdr ranges))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4037 (while (<= first last)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4038 (setq result (cons first result))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4039 (setq first (1+ first)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4040 (nreverse result))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4041 (t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4042 (while ranges
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4043 (if (atom (car ranges))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4044 (if (numberp (car ranges))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4045 (setq result (cons (car ranges) result)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4046 (setq first (caar ranges))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4047 (setq last (cdar ranges))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4048 (while (<= first last)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4049 (setq result (cons first result))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4050 (setq first (1+ first))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4051 (setq ranges (cdr ranges)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4052 (nreverse result)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4053
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4054 (defun gnus-add-to-range (ranges list)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4055 "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
4056 Note: LIST has to be sorted over `<'."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4057 (if (not ranges)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4058 (gnus-compress-sequence list t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4059 (setq list (copy-sequence list))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4060 (or (listp (cdr ranges))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4061 (setq ranges (list ranges)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4062 (let ((out ranges)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4063 ilist lowest highest temp)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4064 (while (and ranges list)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4065 (setq ilist list)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4066 (setq lowest (or (and (atom (car ranges)) (car ranges))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4067 (caar ranges)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4068 (while (and list (cdr list) (< (cadr list) lowest))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4069 (setq list (cdr list)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4070 (if (< (car ilist) lowest)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4071 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4072 (setq temp list)
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 (setcdr temp nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4075 (setq out (nconc (gnus-compress-sequence ilist t) out))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4076 (setq highest (or (and (atom (car ranges)) (car ranges))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4077 (cdar ranges)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4078 (while (and list (<= (car list) highest))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4079 (setq list (cdr list)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4080 (setq ranges (cdr ranges)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4081 (if list
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4082 (setq out (nconc (gnus-compress-sequence list t) out)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4083 (setq out (sort out (lambda (r1 r2)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4084 (< (or (and (atom r1) r1) (car r1))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4085 (or (and (atom r2) r2) (car r2))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4086 (setq ranges out)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4087 (while ranges
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4088 (if (atom (car ranges))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4089 (if (cdr ranges)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4090 (if (atom (cadr ranges))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4091 (if (= (1+ (car ranges)) (cadr ranges))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4092 (progn
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4093 (setcar ranges (cons (car ranges)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4094 (cadr ranges)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4095 (setcdr ranges (cddr ranges))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4096 (if (= (1+ (car ranges)) (caadr ranges))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4097 (progn
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4098 (setcar (cadr ranges) (car ranges))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4099 (setcar ranges (cadr ranges))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4100 (setcdr ranges (cddr ranges))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4101 (if (cdr ranges)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4102 (if (atom (cadr ranges))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4103 (if (= (1+ (cdar ranges)) (cadr ranges))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4104 (progn
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4105 (setcdr (car ranges) (cadr ranges))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4106 (setcdr ranges (cddr ranges))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4107 (if (= (1+ (cdar ranges)) (caadr 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) (cdadr ranges))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4110 (setcdr ranges (cddr ranges)))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4111 (setq ranges (cdr ranges)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4112 out)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4113
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4114 (defun gnus-remove-from-range (ranges list)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4115 "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
4116 Note: LIST has to be sorted over `<'."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4117 ;; !!! 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
4118 (gnus-compress-sequence
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4119 (gnus-sorted-complement
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4120 (gnus-uncompress-range ranges) list)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4121
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4122 (defun gnus-member-of-range (number ranges)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4123 (if (not (listp (cdr ranges)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4124 (and (>= number (car ranges))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4125 (<= number (cdr ranges)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4126 (let ((not-stop t))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4127 (while (and ranges
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4128 (if (numberp (car ranges))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4129 (>= number (car ranges))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4130 (>= number (caar ranges)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4131 not-stop)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4132 (if (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 (and (>= number (caar ranges))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4135 (<= number (cdar ranges))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4136 (setq not-stop nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4137 (setq ranges (cdr ranges)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4138 (not not-stop))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4139
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4140 (defun gnus-range-length (range)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4141 "Return the length RANGE would have if uncompressed."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4142 (length (gnus-uncompress-range range)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4143
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4144 (defun gnus-sublist-p (list sublist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4145 "Test whether all elements in SUBLIST are members of LIST."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4146 (let ((sublistp t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4147 (while sublist
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4148 (unless (memq (pop sublist) list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4149 (setq sublistp nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4150 sublist nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4151 sublistp))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4152
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4153
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4154 ;;;
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4155 ;;; Gnus group mode
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4156 ;;;
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 (defvar gnus-group-mode-map nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4159 (put 'gnus-group-mode 'mode-class 'special)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4160
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4161 (unless gnus-group-mode-map
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4162 (setq gnus-group-mode-map (make-keymap))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4163 (suppress-keymap gnus-group-mode-map)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4164
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4165 (gnus-define-keys gnus-group-mode-map
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4166 " " gnus-group-read-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4167 "=" gnus-group-select-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4168 "\r" gnus-group-select-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4169 "\M-\r" gnus-group-quick-select-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4170 "j" gnus-group-jump-to-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4171 "n" gnus-group-next-unread-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4172 "p" gnus-group-prev-unread-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4173 "\177" gnus-group-prev-unread-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4174 [delete] gnus-group-prev-unread-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4175 "N" gnus-group-next-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4176 "P" gnus-group-prev-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4177 "\M-n" gnus-group-next-unread-group-same-level
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4178 "\M-p" gnus-group-prev-unread-group-same-level
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4179 "," gnus-group-best-unread-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4180 "." gnus-group-first-unread-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4181 "u" gnus-group-unsubscribe-current-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4182 "U" gnus-group-unsubscribe-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4183 "c" gnus-group-catchup-current
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4184 "C" gnus-group-catchup-current-all
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4185 "l" gnus-group-list-groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4186 "L" gnus-group-list-all-groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4187 "m" gnus-group-mail
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4188 "g" gnus-group-get-new-news
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4189 "\M-g" gnus-group-get-new-news-this-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4190 "R" gnus-group-restart
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4191 "r" gnus-group-read-init-file
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4192 "B" gnus-group-browse-foreign-server
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4193 "b" gnus-group-check-bogus-groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4194 "F" gnus-find-new-newsgroups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4195 "\C-c\C-d" gnus-group-describe-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4196 "\M-d" gnus-group-describe-all-groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4197 "\C-c\C-a" gnus-group-apropos
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4198 "\C-c\M-\C-a" gnus-group-description-apropos
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4199 "a" gnus-group-post-news
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4200 "\ek" gnus-group-edit-local-kill
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4201 "\eK" gnus-group-edit-global-kill
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4202 "\C-k" gnus-group-kill-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4203 "\C-y" gnus-group-yank-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4204 "\C-w" gnus-group-kill-region
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4205 "\C-x\C-t" gnus-group-transpose-groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4206 "\C-c\C-l" gnus-group-list-killed
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4207 "\C-c\C-x" gnus-group-expire-articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4208 "\C-c\M-\C-x" gnus-group-expire-all-groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4209 "V" gnus-version
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4210 "s" gnus-group-save-newsrc
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4211 "z" gnus-group-suspend
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4212 ; "Z" gnus-group-clear-dribble
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4213 "q" gnus-group-exit
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4214 "Q" gnus-group-quit
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4215 "?" gnus-group-describe-briefly
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4216 "\C-c\C-i" gnus-info-find-node
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4217 "\M-e" gnus-group-edit-group-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4218 "^" gnus-group-enter-server-mode
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4219 gnus-mouse-2 gnus-mouse-pick-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4220 "<" beginning-of-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4221 ">" end-of-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4222 "\C-c\C-b" gnus-bug
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4223 "\C-c\C-s" gnus-group-sort-groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4224 "t" gnus-topic-mode
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4225 "\C-c\M-g" gnus-activate-all-groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4226 "\M-&" gnus-group-universal-argument
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4227 "#" gnus-group-mark-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4228 "\M-#" gnus-group-unmark-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4229
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4230 (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
4231 "m" gnus-group-mark-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4232 "u" gnus-group-unmark-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4233 "w" gnus-group-mark-region
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4234 "m" gnus-group-mark-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4235 "r" gnus-group-mark-regexp
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4236 "U" gnus-group-unmark-all-groups)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4237
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4238 (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
4239 "d" gnus-group-make-directory-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4240 "h" gnus-group-make-help-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4241 "a" gnus-group-make-archive-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4242 "k" gnus-group-make-kiboze-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4243 "m" gnus-group-make-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4244 "E" gnus-group-edit-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4245 "e" gnus-group-edit-group-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4246 "p" gnus-group-edit-group-parameters
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4247 "v" gnus-group-add-to-virtual
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4248 "V" gnus-group-make-empty-virtual
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4249 "D" gnus-group-enter-directory
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4250 "f" gnus-group-make-doc-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4251 "r" gnus-group-rename-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4252 "\177" gnus-group-delete-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4253 [delete] gnus-group-delete-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4254
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4255 (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
4256 "b" gnus-group-brew-soup
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4257 "w" gnus-soup-save-areas
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4258 "s" gnus-soup-send-replies
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4259 "p" gnus-soup-pack-packet
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4260 "r" nnsoup-pack-replies)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4261
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4262 (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
4263 "s" gnus-group-sort-groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4264 "a" gnus-group-sort-groups-by-alphabet
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4265 "u" gnus-group-sort-groups-by-unread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4266 "l" gnus-group-sort-groups-by-level
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4267 "v" gnus-group-sort-groups-by-score
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4268 "r" gnus-group-sort-groups-by-rank
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4269 "m" gnus-group-sort-groups-by-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4270
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4271 (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
4272 "k" gnus-group-list-killed
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4273 "z" gnus-group-list-zombies
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4274 "s" gnus-group-list-groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4275 "u" gnus-group-list-all-groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4276 "A" gnus-group-list-active
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4277 "a" gnus-group-apropos
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4278 "d" gnus-group-description-apropos
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4279 "m" gnus-group-list-matching
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4280 "M" gnus-group-list-all-matching
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4281 "l" gnus-group-list-level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4282
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4283 (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
4284 "f" gnus-score-flush-cache)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4285
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4286 (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
4287 "f" gnus-group-fetch-faq)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4288
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4289 (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
4290 "l" gnus-group-set-current-level
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4291 "t" gnus-group-unsubscribe-current-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4292 "s" gnus-group-unsubscribe-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4293 "k" gnus-group-kill-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4294 "y" gnus-group-yank-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4295 "w" gnus-group-kill-region
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4296 "\C-k" gnus-group-kill-level
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4297 "z" gnus-group-kill-all-zombies))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4298
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4299 (defun gnus-group-mode ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4300 "Major mode for reading news.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4301
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4302 All normal editing commands are switched off.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4303 \\<gnus-group-mode-map>
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4304 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
4305 `\\[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
4306 lists all zombie groups.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4307
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4308 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
4309 to a group not displayed, type `\\[gnus-group-unsubscribe-group]'.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4310
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4311 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
4312
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4313 The following commands are available:
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4314
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4315 \\{gnus-group-mode-map}"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4316 (interactive)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4317 (when (and menu-bar-mode
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4318 (gnus-visual-p 'group-menu 'menu))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4319 (gnus-group-make-menu-bar))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4320 (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
4321 (gnus-simplify-mode-line)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4322 (setq major-mode 'gnus-group-mode)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4323 (setq mode-name "Group")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4324 (gnus-group-set-mode-line)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4325 (setq mode-line-process nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4326 (use-local-map gnus-group-mode-map)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4327 (buffer-disable-undo (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4328 (setq truncate-lines t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4329 (setq buffer-read-only t)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4330 (gnus-make-local-hook 'post-command-hook)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4331 (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
4332 (run-hooks 'gnus-group-mode-hook))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4333
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4334 (defun gnus-clear-inboxes-moved ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4335 (setq nnmail-moved-inboxes nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4336
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4337 (defun gnus-mouse-pick-group (e)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4338 "Enter the group under the mouse pointer."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4339 (interactive "e")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4340 (mouse-set-point e)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4341 (gnus-group-read-group nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4342
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4343 ;; 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
4344 ;; 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
4345 ;; will depend on whether `gnus-group-use-permanent-levels' is used.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4346 (defun gnus-group-default-level (&optional level number-or-nil)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4347 (cond
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4348 (gnus-group-use-permanent-levels
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4349 (or (setq gnus-group-use-permanent-levels
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4350 (or level (if (numberp gnus-group-use-permanent-levels)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4351 gnus-group-use-permanent-levels
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4352 (or gnus-group-default-list-level
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4353 gnus-level-subscribed))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4354 gnus-group-default-list-level gnus-level-subscribed))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4355 (number-or-nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4356 level)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4357 (t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4358 (or level gnus-group-default-list-level gnus-level-subscribed))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4359
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4360 ;;;###autoload
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4361 (defun gnus-slave-no-server (&optional arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4362 "Read network news as a slave, without connecting to local server"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4363 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4364 (gnus-no-server arg t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4365
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4366 ;;;###autoload
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4367 (defun gnus-no-server (&optional arg slave)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4368 "Read network news.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4369 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
4370 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
4371 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
4372 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
4373 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
4374 (interactive "P")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4375 (let ((val (or arg (1- gnus-level-default-subscribed))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4376 (gnus val t slave)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4377 (make-local-variable 'gnus-group-use-permanent-levels)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4378 (setq gnus-group-use-permanent-levels val)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4379
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4380 ;;;###autoload
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4381 (defun gnus-slave (&optional arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4382 "Read news as a slave."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4383 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4384 (gnus arg nil 'slave))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4385
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4386 ;;;###autoload
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4387 (defun gnus-other-frame (&optional arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4388 "Pop up a frame to read news."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4389 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4390 (if (get-buffer gnus-group-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4391 (let ((pop-up-frames t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4392 (gnus arg))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4393 (select-frame (make-frame))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4394 (gnus arg)))
14359
83a980edc854 (read-news): Define as alias for gnus.
Richard M. Stallman <rms@gnu.org>
parents: 14198
diff changeset
4395
83a980edc854 (read-news): Define as alias for gnus.
Richard M. Stallman <rms@gnu.org>
parents: 14198
diff changeset
4396 ;;;###autoload
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4397 (defun gnus (&optional arg dont-connect slave)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4398 "Read network news.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4399 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
4400 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
4401 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
4402 (interactive "P")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4403
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4404 (if (get-buffer gnus-group-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4405 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4406 (switch-to-buffer gnus-group-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4407 (gnus-group-get-new-news))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4408
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4409 (gnus-clear-system)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4410 (nnheader-init-server-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4411 (gnus-read-init-file)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4412 (setq gnus-slave slave)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4413
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4414 (gnus-group-setup-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4415 (let ((buffer-read-only nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4416 (erase-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4417 (if (not gnus-inhibit-startup-message)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4418 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4419 (gnus-group-startup-message)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4420 (sit-for 0))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4421
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4422 (let ((level (and (numberp arg) (> arg 0) arg))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4423 did-connect)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4424 (unwind-protect
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4425 (progn
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4426 (or dont-connect
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4427 (setq did-connect
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4428 (gnus-start-news-server (and arg (not level))))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4429 (if (and (not dont-connect)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4430 (not did-connect))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4431 (gnus-group-quit)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4432 (run-hooks 'gnus-startup-hook)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4433 ;; NNTP server is successfully open.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4434
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4435 ;; Find the current startup file name.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4436 (setq gnus-current-startup-file
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4437 (gnus-make-newsrc-file gnus-startup-file))
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 ;; Read the dribble file.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4440 (when (or gnus-slave gnus-use-dribble-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4441 (gnus-dribble-read-file))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4442
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4443 ;; Allow using GroupLens predictions.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4444 (when gnus-use-grouplens
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4445 (bbb-login)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4446 (add-hook 'gnus-summary-mode-hook 'gnus-grouplens-mode))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4447
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4448 (gnus-summary-make-display-table)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4449 ;; Do the actual startup.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4450 (gnus-setup-news nil level dont-connect)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4451 ;; Generate the group buffer.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4452 (gnus-group-list-groups level)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4453 (gnus-group-first-unread-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4454 (gnus-configure-windows 'group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4455 (gnus-group-set-mode-line))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4456
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4457 (defun gnus-unload ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4458 "Unload all Gnus features."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4459 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4460 (or (boundp 'load-history)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4461 (error "Sorry, `gnus-unload' is not implemented in this Emacs version."))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4462 (let ((history load-history)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4463 feature)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4464 (while history
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4465 (and (string-match "^\\(gnus\\|nn\\)" (caar history))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4466 (setq feature (cdr (assq 'provide (car history))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4467 (unload-feature feature 'force))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4468 (setq history (cdr history)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4469
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4470 (defun gnus-compile ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4471 "Byte-compile the user-defined format specs."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4472 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4473 (let ((entries gnus-format-specs)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4474 entry gnus-tmp-func)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4475 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4476 (gnus-message 7 "Compiling format specs...")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4477
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4478 (while entries
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4479 (setq entry (pop entries))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4480 (if (eq (car entry) 'version)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4481 (setq gnus-format-specs (delq entry gnus-format-specs))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4482 (when (and (listp (caddr entry))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4483 (not (eq 'byte-code (caaddr entry))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4484 (fset 'gnus-tmp-func
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4485 `(lambda () ,(caddr entry)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4486 (byte-compile 'gnus-tmp-func)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4487 (setcar (cddr entry) (gnus-byte-code 'gnus-tmp-func)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4488
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4489 (push (cons 'version emacs-version) gnus-format-specs)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4490
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4491 (gnus-message 7 "Compiling user specs...done"))))
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 (defun gnus-indent-rigidly (start end arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4494 "Indent rigidly using only spaces and no tabs."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4495 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4496 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4497 (narrow-to-region start end)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4498 (indent-rigidly start end arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4499 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4500 (while (search-forward "\t" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4501 (replace-match " " t t)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4502
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4503 (defun gnus-group-startup-message (&optional x y)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4504 "Insert startup message in current buffer."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4505 ;; Insert the message.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4506 (erase-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4507 (insert
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4508 (format " %s
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4509 _ ___ _ _
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4510 _ ___ __ ___ __ _ ___
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4511 __ _ ___ __ ___
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4512 _ ___ _
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 ""))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4529 ;; And then hack it.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4530 (gnus-indent-rigidly (point-min) (point-max)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4531 (/ (max (- (window-width) (or x 46)) 0) 2))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4532 (goto-char (point-min))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4533 (forward-line 1)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4534 (let* ((pheight (count-lines (point-min) (point-max)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4535 (wheight (window-height))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4536 (rest (- wheight pheight)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4537 (insert (make-string (max 0 (* 2 (/ rest 3))) ?\n)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4538 ;; Fontify some.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4539 (goto-char (point-min))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4540 (and (search-forward "Praxis" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4541 (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
4542 (goto-char (point-min))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4543 (let* ((mode-string (gnus-group-set-mode-line)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4544 (setq mode-line-buffer-identification
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4545 (list (concat gnus-version (substring (car mode-string) 4))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4546 (set-buffer-modified-p t)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4547
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4548 (defun gnus-group-setup-buffer ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4549 (or (get-buffer gnus-group-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4550 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4551 (switch-to-buffer gnus-group-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4552 (gnus-add-current-to-buffer-list)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4553 (gnus-group-mode)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4554 (and gnus-carpal (gnus-carpal-setup-buffer 'group)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4555
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4556 (defun gnus-group-list-groups (&optional level unread lowest)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4557 "List newsgroups with level LEVEL or lower that have unread articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4558 Default is all subscribed groups.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4559 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
4560 listed."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4561 (interactive (list (if current-prefix-arg
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4562 (prefix-numeric-value current-prefix-arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4563 (or
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4564 (gnus-group-default-level nil t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4565 gnus-group-default-list-level
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4566 gnus-level-subscribed))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4567 (or level
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4568 (setq level (car gnus-group-list-mode)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4569 unread (cdr gnus-group-list-mode)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4570 (setq level (gnus-group-default-level level))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4571 (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
4572 (gnus-update-format-specifications)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4573 (let ((case-fold-search nil)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4574 (props (text-properties-at (gnus-point-at-bol)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4575 (group (gnus-group-group-name)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4576 (set-buffer gnus-group-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4577 (funcall gnus-group-prepare-function level unread lowest)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4578 (if (zerop (buffer-size))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4579 (gnus-message 5 gnus-no-groups-message)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4580 (goto-char (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4581 (when (or (not gnus-group-goto-next-group-function)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4582 (not (funcall gnus-group-goto-next-group-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4583 group props)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4584 (if (not group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4585 ;; Go to the first group with unread articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4586 (gnus-group-search-forward t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4587 ;; 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
4588 ;; has disappeared in the new listing, try to find the next
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4589 ;; 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
4590 ;; first newsgroup in the buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4591 (if (not (gnus-goto-char
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4592 (text-property-any
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4593 (point-min) (point-max)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4594 'gnus-group (gnus-intern-safe group gnus-active-hashtb))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4595 (let ((newsrc (cdddr (gnus-gethash group gnus-newsrc-hashtb))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4596 (while (and newsrc
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4597 (not (gnus-goto-char
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4598 (text-property-any
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4599 (point-min) (point-max) 'gnus-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4600 (gnus-intern-safe
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4601 (caar newsrc) gnus-active-hashtb)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4602 (setq newsrc (cdr newsrc)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4603 (or newsrc (progn (goto-char (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4604 (forward-line -1)))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4605 ;; Adjust cursor point.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4606 (gnus-group-position-point))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4607
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4608 (defun gnus-group-list-level (level &optional all)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4609 "List groups on LEVEL.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4610 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
4611 (interactive "nList groups on level: \nP")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4612 (gnus-group-list-groups level all level))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4613
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4614 (defun gnus-group-prepare-flat (level &optional all lowest regexp)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4615 "List all newsgroups with unread articles of level LEVEL or lower.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4616 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
4617 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
4618 If REGEXP, only list groups matching REGEXP."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4619 (set-buffer gnus-group-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4620 (let ((buffer-read-only nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4621 (newsrc (cdr gnus-newsrc-alist))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4622 (lowest (or lowest 1))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4623 info clevel unread group params)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4624 (erase-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4625 (if (< lowest gnus-level-zombie)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4626 ;; List living groups.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4627 (while newsrc
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4628 (setq info (car newsrc)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4629 group (gnus-info-group info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4630 params (gnus-info-params info)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4631 newsrc (cdr newsrc)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4632 unread (car (gnus-gethash group gnus-newsrc-hashtb)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4633 (and unread ; This group might be bogus
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4634 (or (not regexp)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4635 (string-match regexp group))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4636 (<= (setq clevel (gnus-info-level info)) level)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4637 (>= clevel lowest)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4638 (or all ; We list all groups?
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4639 (if (eq unread t) ; Unactivated?
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4640 gnus-group-list-inactive-groups ; We list unactivated
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4641 (> unread 0)) ; We list groups with unread articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4642 (and gnus-list-groups-with-ticked-articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4643 (cdr (assq 'tick (gnus-info-marks info))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4644 ; And groups with tickeds
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4645 ;; Check for permanent visibility.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4646 (and gnus-permanently-visible-groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4647 (string-match gnus-permanently-visible-groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4648 group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4649 (memq 'visible params)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4650 (cdr (assq 'visible params)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4651 (gnus-group-insert-group-line
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4652 group (gnus-info-level info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4653 (gnus-info-marks info) unread (gnus-info-method info)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4654
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4655 ;; List dead groups.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4656 (and (>= level gnus-level-zombie) (<= lowest gnus-level-zombie)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4657 (gnus-group-prepare-flat-list-dead
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4658 (setq gnus-zombie-list (sort gnus-zombie-list 'string<))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4659 gnus-level-zombie ?Z
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4660 regexp))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4661 (and (>= level gnus-level-killed) (<= lowest gnus-level-killed)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4662 (gnus-group-prepare-flat-list-dead
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4663 (setq gnus-killed-list (sort gnus-killed-list 'string<))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4664 gnus-level-killed ?K regexp))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4665
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4666 (gnus-group-set-mode-line)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4667 (setq gnus-group-list-mode (cons level all))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4668 (run-hooks 'gnus-group-prepare-hook)))
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 (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
4671 ;; List zombies and killed lists somewhat faster, which was
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4672 ;; 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
4673 ;; this by ignoring the group format specification altogether.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4674 (let (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4675 (if regexp
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4676 ;; This loop is used when listing groups that match some
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4677 ;; regexp.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4678 (while groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4679 (setq group (pop groups))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4680 (when (string-match regexp group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4681 (gnus-add-text-properties
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4682 (point) (prog1 (1+ (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4683 (insert " " mark " *: " group "\n"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4684 (list 'gnus-group (gnus-intern-safe group gnus-active-hashtb)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4685 'gnus-unread t
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4686 'gnus-level level))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4687 ;; This loop is used when listing all groups.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4688 (while groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4689 (gnus-add-text-properties
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4690 (point) (prog1 (1+ (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4691 (insert " " mark " *: "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4692 (setq group (pop groups)) "\n"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4693 (list 'gnus-group (gnus-intern-safe group gnus-active-hashtb)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4694 'gnus-unread t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4695 'gnus-level level))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4696
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4697 (defmacro gnus-group-real-name (group)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4698 "Find the real name of a foreign newsgroup."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4699 `(let ((gname ,group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4700 (if (string-match ":[^:]+$" gname)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4701 (substring gname (1+ (match-beginning 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4702 gname)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4703
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4704 (defsubst gnus-server-add-address (method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4705 (let ((method-name (symbol-name (car method))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4706 (if (and (memq 'address (assoc method-name gnus-valid-select-methods))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4707 (not (assq (intern (concat method-name "-address")) method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4708 (append method (list (list (intern (concat method-name "-address"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4709 (nth 1 method))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4710 method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4711
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4712 (defsubst gnus-server-get-method (group method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4713 ;; Input either a server name, and extended server name, or a
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4714 ;; select method, and return a select method.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4715 (cond ((stringp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4716 (gnus-server-to-method method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4717 ((equal method gnus-select-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4718 gnus-select-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4719 ((and (stringp (car method)) group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4720 (gnus-server-extend-method group method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4721 ((and method (not group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4722 (equal (cadr method) ""))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4723 method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4724 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4725 (gnus-server-add-address method))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4726
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4727 (defun gnus-server-to-method (server)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4728 "Map virtual server names to select methods."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4729 (or
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4730 ;; Is this a method, perhaps?
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4731 (and server (listp server) server)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4732 ;; Perhaps this is the native server?
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4733 (and (equal server "native") gnus-select-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4734 ;; It should be in the server alist.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4735 (cdr (assoc server gnus-server-alist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4736 ;; If not, we look through all the opened server
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4737 ;; to see whether we can find it there.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4738 (let ((opened gnus-opened-servers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4739 (while (and opened
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4740 (not (equal server (format "%s:%s" (caaar opened)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4741 (cadaar opened)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4742 (pop opened))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4743 (caar opened))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4744
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4745 (defmacro gnus-method-equal (ss1 ss2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4746 "Say whether two servers are equal."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4747 `(let ((s1 ,ss1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4748 (s2 ,ss2))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4749 (or (equal s1 s2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4750 (and (= (length s1) (length s2))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4751 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4752 (while (and s1 (member (car s1) s2))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4753 (setq s1 (cdr s1)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4754 (null s1))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4755
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4756 (defun gnus-server-equal (m1 m2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4757 "Say whether two methods are equal."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4758 (let ((m1 (cond ((null m1) gnus-select-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4759 ((stringp m1) (gnus-server-to-method m1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4760 (t m1)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4761 (m2 (cond ((null m2) gnus-select-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4762 ((stringp m2) (gnus-server-to-method m2))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4763 (t m2))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4764 (gnus-method-equal m1 m2)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4765
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4766 (defun gnus-servers-using-backend (backend)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4767 "Return a list of known servers using BACKEND."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4768 (let ((opened gnus-opened-servers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4769 out)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4770 (while opened
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4771 (when (eq backend (caaar opened))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4772 (push (caar opened) out))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4773 (pop opened))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4774 out))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4775
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
4776 (defun gnus-archive-server-wanted-p ()
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
4777 "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
4778 (cond
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
4779 ((or (not gnus-message-archive-method)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
4780 (not gnus-message-archive-group))
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
4781 nil)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
4782 ((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
4783 t)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
4784 (t
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
4785 (let ((active (cadr (assq 'nnfolder-active-file
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
4786 gnus-message-archive-method))))
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
4787 (and active
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
4788 (file-exists-p active))))))
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
4789
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4790 (defun gnus-group-prefixed-name (group method)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4791 "Return the whole name from GROUP and METHOD."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4792 (and (stringp method) (setq method (gnus-server-to-method method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4793 (concat (format "%s" (car method))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4794 (if (and
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4795 (or (assoc (format "%s" (car method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4796 (gnus-methods-using 'address))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4797 (gnus-server-equal method gnus-message-archive-method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4798 (nth 1 method)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4799 (not (string= (nth 1 method) "")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4800 (concat "+" (nth 1 method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4801 ":" group))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4802
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4803 (defun gnus-group-real-prefix (group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4804 "Return the prefix of the current group name."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4805 (if (string-match "^[^:]+:" group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4806 (substring group 0 (match-end 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4807 ""))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4808
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4809 (defun gnus-group-method (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4810 "Return the server or method used for selecting GROUP."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4811 (let ((prefix (gnus-group-real-prefix group)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4812 (if (equal prefix "")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4813 gnus-select-method
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4814 (let ((servers gnus-opened-servers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4815 (server "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4816 backend possible found)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4817 (if (string-match "^[^\\+]+\\+" prefix)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4818 (setq backend (intern (substring prefix 0 (1- (match-end 0))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4819 server (substring prefix (match-end 0) (1- (length prefix))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4820 (setq backend (intern (substring prefix 0 (1- (length prefix))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4821 (while servers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4822 (when (eq (caaar servers) backend)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4823 (setq possible (caar servers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4824 (when (equal (cadaar servers) server)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4825 (setq found (caar servers))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4826 (pop servers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4827 (or (car (rassoc found gnus-server-alist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4828 found
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4829 (car (rassoc possible gnus-server-alist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4830 possible
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4831 (list backend server))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4832
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4833 (defsubst gnus-secondary-method-p (method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4834 "Return whether METHOD is a secondary select method."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4835 (let ((methods gnus-secondary-select-methods)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4836 (gmethod (gnus-server-get-method nil method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4837 (while (and methods
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4838 (not (equal (gnus-server-get-method nil (car methods))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4839 gmethod)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4840 (setq methods (cdr methods)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4841 methods))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4842
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4843 (defun gnus-group-foreign-p (group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4844 "Say whether a group is foreign or not."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4845 (and (not (gnus-group-native-p group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4846 (not (gnus-group-secondary-p group))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4847
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4848 (defun gnus-group-native-p (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4849 "Say whether the group is native or not."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4850 (not (string-match ":" 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-secondary-p (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4853 "Say whether the group is secondary or not."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4854 (gnus-secondary-method-p (gnus-find-method-for-group 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-get-parameter (group &optional symbol)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4857 "Returns the group parameters for GROUP.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4858 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
4859 (let ((params (gnus-info-params (gnus-get-info group))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4860 (if symbol
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4861 (gnus-group-parameter-value params symbol)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4862 params)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4863
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4864 (defun gnus-group-parameter-value (params symbol)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4865 "Return the value of SYMBOL in group PARAMS."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4866 (or (car (memq symbol params)) ; It's either a simple symbol
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4867 (cdr (assq symbol params)))) ; or a cons.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4868
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4869 (defun gnus-group-add-parameter (group param)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4870 "Add parameter PARAM to GROUP."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4871 (let ((info (gnus-get-info group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4872 (if (not info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4873 () ; This is a dead group. We just ignore it.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4874 ;; Cons the new param to the old one and update.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4875 (gnus-group-set-info (cons param (gnus-info-params info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4876 group 'params))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4877
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4878 (defun gnus-group-set-parameter (group name value)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4879 "Set parameter NAME to VALUE in GROUP."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4880 (let ((info (gnus-get-info group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4881 (if (not info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4882 () ; This is a dead group. We just ignore it.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4883 (let ((old-params (gnus-info-params info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4884 (new-params (list (cons name value))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4885 (while old-params
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4886 (if (or (not (listp (car old-params)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4887 (not (eq (caar old-params) name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4888 (setq new-params (append new-params (list (car old-params)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4889 (setq old-params (cdr old-params)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4890 (gnus-group-set-info new-params group 'params)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4891
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4892 (defun gnus-group-add-score (group &optional score)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4893 "Add SCORE to the GROUP score.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4894 If SCORE is nil, add 1 to the score of GROUP."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4895 (let ((info (gnus-get-info group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4896 (when info
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4897 (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
4898
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4899 (defun gnus-summary-bubble-group ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4900 "Increase the score of the current group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4901 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
4902 increase the score of each group you read."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4903 (gnus-group-add-score gnus-newsgroup-name))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4904
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4905 (defun gnus-group-set-info (info &optional method-only-group part)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4906 (let* ((entry (gnus-gethash
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4907 (or method-only-group (gnus-info-group info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4908 gnus-newsrc-hashtb))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4909 (part-info info)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4910 (info (if method-only-group (nth 2 entry) info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4911 method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4912 (when method-only-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4913 (unless entry
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4914 (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
4915 ;; 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
4916 ;; select method or the group parameters. We first check
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4917 ;; 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
4918 (let ((len (length info))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4919 (total (if (eq part 'method) 5 6)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4920 (when (< len total)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4921 (setcdr (nthcdr (1- len) info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4922 (make-list (- total len) nil)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4923 ;; Then we enter the new info.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4924 (setcar (nthcdr (1- total) info) part-info)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4925 (unless entry
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4926 ;; This is a new group, so we just create it.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4927 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4928 (set-buffer gnus-group-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4929 (setq method (gnus-info-method info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4930 (when (gnus-server-equal method "native")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4931 (setq method nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4932 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4933 (set-buffer gnus-group-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4934 (if method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4935 ;; It's a foreign group...
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4936 (gnus-group-make-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4937 (gnus-group-real-name (gnus-info-group info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4938 (if (stringp method) method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4939 (prin1-to-string (car method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4940 (and (consp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4941 (nth 1 (gnus-info-method info))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4942 ;; It's a native group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4943 (gnus-group-make-group (gnus-info-group info))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4944 (gnus-message 6 "Note: New group created")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4945 (setq entry
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4946 (gnus-gethash (gnus-group-prefixed-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4947 (gnus-group-real-name (gnus-info-group info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4948 (or (gnus-info-method info) gnus-select-method))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4949 gnus-newsrc-hashtb))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4950 ;; 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
4951 ;; can do the update.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4952 (if entry
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4953 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4954 (setcar (nthcdr 2 entry) info)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4955 (when (and (not (eq (car entry) t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4956 (gnus-active (gnus-info-group info)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4957 (setcar entry (length (gnus-list-of-unread-articles (car info))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4958 (error "No such group: %s" (gnus-info-group info)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4959
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4960 (defun gnus-group-set-method-info (group select-method)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4961 (gnus-group-set-info select-method group 'method))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4962
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4963 (defun gnus-group-set-params-info (group params)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4964 (gnus-group-set-info params group 'params))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4965
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4966 (defun gnus-group-update-group-line ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4967 "Update the current line in the group buffer."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4968 (let* ((buffer-read-only nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4969 (group (gnus-group-group-name))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4970 (entry (and group (gnus-gethash group gnus-newsrc-hashtb)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4971 gnus-group-indentation)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4972 (when group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4973 (and entry
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4974 (not (gnus-ephemeral-group-p group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4975 (gnus-dribble-enter
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4976 (concat "(gnus-group-set-info '"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4977 (prin1-to-string (nth 2 entry)) ")")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4978 (setq gnus-group-indentation (gnus-group-group-indentation))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4979 (gnus-delete-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4980 (gnus-group-insert-group-line-info group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4981 (forward-line -1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4982 (gnus-group-position-point))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4983
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4984 (defun gnus-group-insert-group-line-info (group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4985 "Insert GROUP on the current line."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4986 (let ((entry (gnus-gethash group gnus-newsrc-hashtb))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4987 active info)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4988 (if entry
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4989 (progn
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4990 ;; (Un)subscribed group.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4991 (setq info (nth 2 entry))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4992 (gnus-group-insert-group-line
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4993 group (gnus-info-level info) (gnus-info-marks info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4994 (or (car entry) t) (gnus-info-method info)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4995 ;; This group is dead.
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
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4998 (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
4999 nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5000 (if (setq active (gnus-active group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5001 (- (1+ (cdr active)) (car active)) 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5002 nil))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5003
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5004 (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
5005 gnus-tmp-marked number
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5006 gnus-tmp-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5007 "Insert a group line in the group buffer."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5008 (let* ((gnus-tmp-active (gnus-active gnus-tmp-group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5009 (gnus-tmp-number-total
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5010 (if gnus-tmp-active
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5011 (1+ (- (cdr gnus-tmp-active) (car gnus-tmp-active)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5012 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5013 (gnus-tmp-number-of-unread
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5014 (if (numberp number) (int-to-string (max 0 number))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5015 "*"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5016 (gnus-tmp-number-of-read
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5017 (if (numberp number)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5018 (int-to-string (max 0 (- gnus-tmp-number-total number)))
13401
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-subscribed
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5021 (cond ((<= gnus-tmp-level gnus-level-subscribed) ? )
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5022 ((<= gnus-tmp-level gnus-level-unsubscribed) ?U)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5023 ((= gnus-tmp-level gnus-level-zombie) ?Z)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5024 (t ?K)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5025 (gnus-tmp-qualified-group (gnus-group-real-name gnus-tmp-group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5026 (gnus-tmp-newsgroup-description
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5027 (if gnus-description-hashtb
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5028 (or (gnus-gethash gnus-tmp-group gnus-description-hashtb) "")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5029 ""))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5030 (gnus-tmp-moderated
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5031 (if (member gnus-tmp-group gnus-moderated-list) ?m ? ))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5032 (gnus-tmp-moderated-string
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5033 (if (eq gnus-tmp-moderated ?m) "(m)" ""))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5034 (gnus-tmp-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5035 (gnus-server-get-method gnus-tmp-group gnus-tmp-method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5036 (gnus-tmp-news-server (or (cadr gnus-tmp-method) ""))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5037 (gnus-tmp-news-method (or (car gnus-tmp-method) ""))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5038 (gnus-tmp-news-method-string
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5039 (if gnus-tmp-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5040 (format "(%s:%s)" (car gnus-tmp-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5041 (cadr gnus-tmp-method)) ""))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5042 (gnus-tmp-marked-mark
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5043 (if (and (numberp number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5044 (zerop number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5045 (cdr (assq 'tick gnus-tmp-marked)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5046 ?* ? ))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5047 (gnus-tmp-process-marked
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5048 (if (member gnus-tmp-group gnus-group-marked)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5049 gnus-process-mark ? ))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5050 (gnus-tmp-grouplens
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5051 (or (and gnus-use-grouplens
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5052 (bbb-grouplens-group-p gnus-tmp-group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5053 ""))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5054 (buffer-read-only nil)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5055 header gnus-tmp-header) ; passed as parameter to user-funcs.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5056 (beginning-of-line)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5057 (gnus-add-text-properties
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5058 (point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5059 (prog1 (1+ (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5060 ;; Insert the text.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5061 (eval gnus-group-line-format-spec))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5062 `(gnus-group ,(gnus-intern-safe gnus-tmp-group gnus-active-hashtb)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5063 gnus-unread ,(if (numberp number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5064 (string-to-int gnus-tmp-number-of-unread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5065 t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5066 gnus-marked ,gnus-tmp-marked-mark
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5067 gnus-indentation ,gnus-group-indentation
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5068 gnus-level ,gnus-tmp-level))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5069 (when (inline (gnus-visual-p 'group-highlight 'highlight))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5070 (forward-line -1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5071 (run-hooks 'gnus-group-update-hook)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5072 (forward-line))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5073 ;; Allow XEmacs to remove front-sticky text properties.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5074 (gnus-group-remove-excess-properties)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5075
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5076 (defun gnus-group-update-group (group &optional visible-only)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5077 "Update all lines where GROUP appear.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5078 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
5079 already."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5080 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5081 (set-buffer gnus-group-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5082 ;; The buffer may be narrowed.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5083 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5084 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5085 (let ((ident (gnus-intern-safe group gnus-active-hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5086 (loc (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5087 found buffer-read-only)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5088 ;; Enter the current status into the dribble buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5089 (let ((entry (gnus-gethash group gnus-newsrc-hashtb)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5090 (if (and entry (not (gnus-ephemeral-group-p group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5091 (gnus-dribble-enter
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5092 (concat "(gnus-group-set-info '" (prin1-to-string (nth 2 entry))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5093 ")"))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5094 ;; Find all group instances. If topics are in use, each group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5095 ;; may be listed in more than once.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5096 (while (setq loc (text-property-any
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5097 loc (point-max) 'gnus-group ident))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5098 (setq found t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5099 (goto-char loc)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5100 (let ((gnus-group-indentation (gnus-group-group-indentation)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5101 (gnus-delete-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5102 (gnus-group-insert-group-line-info group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5103 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5104 (forward-line -1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5105 (run-hooks 'gnus-group-update-group-hook)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5106 (setq loc (1+ loc)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5107 (unless (or found visible-only)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5108 ;; 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
5109 ;; 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
5110 (if gnus-goto-missing-group-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5111 (funcall gnus-goto-missing-group-function group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5112 (let ((entry (cddr (gnus-gethash group gnus-newsrc-hashtb))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5113 (while (and entry (car entry)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5114 (not
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5115 (gnus-goto-char
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5116 (text-property-any
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5117 (point-min) (point-max)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5118 'gnus-group (gnus-intern-safe
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5119 (caar entry) gnus-active-hashtb)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5120 (setq entry (cdr entry)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5121 (or entry (goto-char (point-max)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5122 ;; Finally insert the line.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5123 (let ((gnus-group-indentation (gnus-group-group-indentation)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5124 (gnus-group-insert-group-line-info group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5125 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5126 (forward-line -1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5127 (run-hooks 'gnus-group-update-group-hook))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5128 (gnus-group-set-mode-line)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5129
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5130 (defun gnus-group-set-mode-line ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5131 "Update the mode line in the group buffer."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5132 (when (memq 'group gnus-updated-mode-lines)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5133 ;; Yes, we want to keep this mode line updated.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5134 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5135 (set-buffer gnus-group-buffer)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5136 (let* ((gformat (or gnus-group-mode-line-format-spec
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5137 (setq gnus-group-mode-line-format-spec
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5138 (gnus-parse-format
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5139 gnus-group-mode-line-format
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5140 gnus-group-mode-line-format-alist))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5141 (gnus-tmp-news-server (cadr gnus-select-method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5142 (gnus-tmp-news-method (car gnus-select-method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5143 (gnus-tmp-colon (if (equal gnus-tmp-news-server "") "" ":"))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5144 (max-len 60)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5145 gnus-tmp-header ;Dummy binding for user-defined formats
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5146 ;; Get the resulting string.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5147 (modified
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5148 (and gnus-dribble-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5149 (buffer-name gnus-dribble-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5150 (buffer-modified-p gnus-dribble-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5151 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5152 (set-buffer gnus-dribble-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5153 (not (zerop (buffer-size))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5154 (mode-string (eval gformat)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5155 ;; Say whether the dribble buffer has been modified.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5156 (setq mode-line-modified
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5157 (if modified "---*- " "----- "))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5158 ;; If the line is too long, we chop it off.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5159 (when (> (length mode-string) max-len)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5160 (setq mode-string (substring mode-string 0 (- max-len 4))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5161 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5162 (setq mode-line-buffer-identification
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5163 (gnus-mode-line-buffer-identification
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5164 (list mode-string)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5165 (set-buffer-modified-p modified))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5166
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5167 (defun gnus-group-group-name ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5168 "Get the name of the newsgroup on the current line."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5169 (let ((group (get-text-property (gnus-point-at-bol) 'gnus-group)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5170 (and group (symbol-name group))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5171
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5172 (defun gnus-group-group-level ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5173 "Get the level of the newsgroup on the current line."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5174 (get-text-property (gnus-point-at-bol) 'gnus-level))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5175
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5176 (defun gnus-group-group-indentation ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5177 "Get the indentation of the newsgroup on the current line."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5178 (or (get-text-property (gnus-point-at-bol) 'gnus-indentation)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5179 (and gnus-group-indentation-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5180 (funcall gnus-group-indentation-function))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5181 ""))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5182
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5183 (defun gnus-group-group-unread ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5184 "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
5185 (get-text-property (gnus-point-at-bol) 'gnus-unread))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5186
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5187 (defun gnus-group-search-forward (&optional backward all level first-too)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5188 "Find the next newsgroup with unread articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5189 If BACKWARD is non-nil, find the previous newsgroup instead.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5190 If ALL is non-nil, just find any newsgroup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5191 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
5192 group exists.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5193 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
5194 (let ((way (if backward -1 1))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5195 (low gnus-level-killed)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5196 (beg (point))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5197 pos found lev)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5198 (if (and backward (progn (beginning-of-line)) (bobp))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5199 nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5200 (or first-too (forward-line way))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5201 (while (and
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5202 (not (eobp))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5203 (not (setq
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5204 found
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5205 (and (or all
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5206 (and
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5207 (let ((unread
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5208 (get-text-property (point) 'gnus-unread)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5209 (and (numberp unread) (> unread 0)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5210 (setq lev (get-text-property (point)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5211 'gnus-level))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5212 (<= lev gnus-level-subscribed)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5213 (or (not level)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5214 (and (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 (or (= lev level)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5217 (and (< lev low)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5218 (< level lev)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5219 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5220 (setq low lev)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5221 (setq pos (point))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5222 nil))))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5223 (zerop (forward-line way)))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5224 (if found
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5225 (progn (gnus-group-position-point) t)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5226 (goto-char (or pos beg))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5227 (and pos t))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5228
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5229 ;;; Gnus group mode commands
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5230
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5231 ;; Group marking.
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 (defun gnus-group-mark-group (n &optional unmark no-advance)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5234 "Mark the current group."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5235 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5236 (let ((buffer-read-only nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5237 group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5238 (while (and (> n 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5239 (not (eobp)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5240 (when (setq group (gnus-group-group-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5241 ;; Update the mark.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5242 (beginning-of-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5243 (forward-char
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5244 (or (cdr (assq 'process gnus-group-mark-positions)) 2))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5245 (delete-char 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5246 (if unmark
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5247 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5248 (insert " ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5249 (setq gnus-group-marked (delete group gnus-group-marked)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5250 (insert "#")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5251 (setq gnus-group-marked
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5252 (cons group (delete group gnus-group-marked)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5253 (or no-advance (gnus-group-next-group 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5254 (decf n))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5255 (gnus-summary-position-point)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5256 n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5257
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5258 (defun gnus-group-unmark-group (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5259 "Remove the mark from the current group."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5260 (interactive "p")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5261 (gnus-group-mark-group n 'unmark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5262 (gnus-group-position-point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5263
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5264 (defun gnus-group-unmark-all-groups ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5265 "Unmark all groups."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5266 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5267 (let ((groups gnus-group-marked))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5268 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5269 (while groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5270 (gnus-group-remove-mark (pop groups)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5271 (gnus-group-position-point))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5272
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5273 (defun gnus-group-mark-region (unmark beg end)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5274 "Mark all groups between point and mark.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5275 If UNMARK, remove the mark instead."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5276 (interactive "P\nr")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5277 (let ((num (count-lines beg end)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5278 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5279 (goto-char beg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5280 (- num (gnus-group-mark-group num unmark)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5281
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5282 (defun gnus-group-mark-buffer (&optional unmark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5283 "Mark all groups in the buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5284 If UNMARK, remove the mark instead."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5285 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5286 (gnus-group-mark-region unmark (point-min) (point-max)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5287
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5288 (defun gnus-group-mark-regexp (regexp)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5289 "Mark all groups that match some regexp."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5290 (interactive "sMark (regexp): ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5291 (let ((alist (cdr gnus-newsrc-alist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5292 group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5293 (while alist
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5294 (when (string-match regexp (setq group (gnus-info-group (pop alist))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5295 (gnus-group-set-mark group))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5296 (gnus-group-position-point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5297
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5298 (defun gnus-group-remove-mark (group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5299 "Remove the process mark from GROUP and move point there.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5300 Return nil if the group isn't displayed."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5301 (if (gnus-group-goto-group group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5302 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5303 (gnus-group-mark-group 1 'unmark t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5304 t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5305 (setq gnus-group-marked
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5306 (delete group gnus-group-marked))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5307 nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5308
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5309 (defun gnus-group-set-mark (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5310 "Set the process mark on GROUP."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5311 (if (gnus-group-goto-group group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5312 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5313 (gnus-group-mark-group 1 nil t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5314 (setq gnus-group-marked (cons group (delete group gnus-group-marked)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5315
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5316 (defun gnus-group-universal-argument (arg &optional groups func)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5317 "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
5318 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5319 (let ((groups (or groups (gnus-group-process-prefix arg)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5320 group func)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5321 (if (eq (setq func (or func
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5322 (key-binding
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5323 (read-key-sequence
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5324 (substitute-command-keys
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5325 "\\<gnus-group-mode-map>\\[gnus-group-universal-argument]")))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5326 'undefined)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5327 (gnus-error 1 "Undefined key")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5328 (while groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5329 (gnus-group-remove-mark (setq group (pop groups)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5330 (command-execute func))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5331 (gnus-group-position-point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5332
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5333 (defun gnus-group-process-prefix (n)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5334 "Return a list of groups to work on.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5335 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
5336 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5337 (n
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5338 (setq n (prefix-numeric-value n))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5339 ;; 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
5340 ;; groups.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5341 (let ((way (if (< n 0) -1 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5342 (n (abs n))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5343 group groups)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5344 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5345 (while (and (> n 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5346 (setq group (gnus-group-group-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5347 (setq groups (cons group groups))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5348 (setq n (1- n))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5349 (gnus-group-next-group way)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5350 (nreverse groups)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5351 ((and (boundp 'transient-mark-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5352 transient-mark-mode
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5353 (boundp 'mark-active)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5354 mark-active)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5355 ;; Work on the region between point and mark.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5356 (let ((max (max (point) (mark)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5357 groups)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5358 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5359 (goto-char (min (point) (mark)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5360 (while
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5361 (and
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5362 (push (gnus-group-group-name) groups)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5363 (zerop (gnus-group-next-group 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5364 (< (point) max)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5365 (nreverse groups))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5366 (gnus-group-marked
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5367 ;; No prefix, but a list of marked articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5368 (reverse gnus-group-marked))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5369 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5370 ;; Neither marked articles or a prefix, so we return the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5371 ;; current group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5372 (let ((group (gnus-group-group-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5373 (and group (list group))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5374
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5375 ;; Selecting groups.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5376
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5377 (defun gnus-group-read-group (&optional all no-article group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5378 "Read news in this newsgroup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5379 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
5380 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
5381 optional argument NO-ARTICLE is non-nil, no article will be
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5382 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
5383 group."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5384 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5385 (let ((group (or group (gnus-group-group-name)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5386 number active marked entry)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5387 (or group (error "No group on current line"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5388 (setq marked (nth 3 (nth 2 (setq entry (gnus-gethash
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5389 group gnus-newsrc-hashtb)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5390 ;; 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
5391 ;; the number of unread articles from `gnus-active-hashtb'.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5392 (setq number
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5393 (cond ((numberp all) all)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5394 (entry (car entry))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5395 ((setq active (gnus-active group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5396 (- (1+ (cdr active)) (car active)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5397 (gnus-summary-read-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5398 group (or all (and (numberp number)
15959
2f732db1918c 1996-08-28 Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15945
diff changeset
5399 (zerop (+ number (gnus-range-length
2f732db1918c 1996-08-28 Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15945
diff changeset
5400 (cdr (assq 'tick marked)))
2f732db1918c 1996-08-28 Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15945
diff changeset
5401 (gnus-range-length
2f732db1918c 1996-08-28 Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15945
diff changeset
5402 (cdr (assq 'dormant marked)))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5403 no-article)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5404
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5405 (defun gnus-group-select-group (&optional all)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5406 "Select this newsgroup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5407 No article is selected automatically.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5408 If ALL is non-nil, already read articles become readable.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5409 If ALL is a number, fetch this number of articles."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5410 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5411 (gnus-group-read-group all t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5412
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5413 (defun gnus-group-quick-select-group (&optional all)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5414 "Select the current group \"quickly\".
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5415 This means that no highlighting or scoring will be performed."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5416 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5417 (let (gnus-visual
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5418 gnus-score-find-score-files-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5419 gnus-apply-kill-hook
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5420 gnus-summary-expunge-below)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5421 (gnus-group-read-group all t)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5422
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5423 (defun gnus-group-visible-select-group (&optional all)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5424 "Select the current group without hiding any articles."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5425 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5426 (let ((gnus-inhibit-limiting t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5427 (gnus-group-read-group all t)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5428
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5429 ;;;###autoload
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5430 (defun gnus-fetch-group (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5431 "Start Gnus if necessary and enter GROUP.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5432 Returns whether the fetching was successful or not."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5433 (interactive "sGroup name: ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5434 (or (get-buffer gnus-group-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5435 (gnus))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5436 (gnus-group-read-group nil nil group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5437
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5438 ;; 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
5439 ;; if selection was successful.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5440 (defun gnus-group-read-ephemeral-group
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5441 (group method &optional activate quit-config)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5442 (let ((group (if (gnus-group-foreign-p group) group
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5443 (gnus-group-prefixed-name group method))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5444 (gnus-sethash
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5445 group
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5446 `(t nil (,group ,gnus-level-default-subscribed nil nil ,method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5447 ((quit-config . ,(if quit-config quit-config
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5448 (cons (current-buffer) 'summary))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5449 gnus-newsrc-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5450 (set-buffer gnus-group-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5451 (or (gnus-check-server method)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5452 (error "Unable to contact server: %s" (gnus-status-message method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5453 (if activate (or (gnus-request-group group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5454 (error "Couldn't request group")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5455 (condition-case ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5456 (gnus-group-read-group t t group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5457 (error nil)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5458 (quit nil))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5459
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5460 (defun gnus-group-jump-to-group (group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5461 "Jump to newsgroup GROUP."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5462 (interactive
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5463 (list (completing-read
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5464 "Group: " gnus-active-hashtb nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5465 (gnus-read-active-file-p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5466 nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5467 'gnus-group-history)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5468
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5469 (when (equal group "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5470 (error "Empty group name"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5471
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5472 (when (string-match "[\000-\032]" group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5473 (error "Control characters in group: %s" group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5474
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5475 (let ((b (text-property-any
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5476 (point-min) (point-max)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5477 'gnus-group (gnus-intern-safe group gnus-active-hashtb))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5478 (unless (gnus-ephemeral-group-p group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5479 (if b
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5480 ;; Either go to the line in the group buffer...
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5481 (goto-char b)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5482 ;; ... or insert the line.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5483 (or
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5484 (gnus-active group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5485 (gnus-activate-group group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5486 (error "%s error: %s" group (gnus-status-message group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5487
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5488 (gnus-group-update-group group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5489 (goto-char (text-property-any
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5490 (point-min) (point-max)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5491 'gnus-group (gnus-intern-safe group gnus-active-hashtb)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5492 ;; Adjust cursor point.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5493 (gnus-group-position-point)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5494
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5495 (defun gnus-group-goto-group (group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5496 "Goto to newsgroup GROUP."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5497 (when group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5498 (let ((b (text-property-any (point-min) (point-max)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5499 'gnus-group (gnus-intern-safe
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5500 group gnus-active-hashtb))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5501 (and b (goto-char b)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5502
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5503 (defun gnus-group-next-group (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5504 "Go to next N'th newsgroup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5505 If N is negative, search backward instead.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5506 Returns the difference between N and the number of skips actually
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5507 done."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5508 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5509 (gnus-group-next-unread-group n t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5510
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5511 (defun gnus-group-next-unread-group (n &optional all level)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5512 "Go to next N'th unread newsgroup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5513 If N is negative, search backward instead.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5514 If ALL is non-nil, choose any newsgroup, unread or not.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5515 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
5516 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
5517 LEVEL.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5518 Returns the difference between N and the number of skips actually
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5519 made."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5520 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5521 (let ((backward (< n 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5522 (n (abs n)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5523 (while (and (> n 0)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5524 (gnus-group-search-forward
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5525 backward (or (not gnus-group-goto-unread) all) level))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5526 (setq n (1- n)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5527 (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
5528 (if level " on this level or higher" "")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5529 n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5530
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5531 (defun gnus-group-prev-group (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5532 "Go to previous N'th newsgroup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5533 Returns the difference between N and the number of skips actually
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5534 done."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5535 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5536 (gnus-group-next-unread-group (- n) t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5537
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5538 (defun gnus-group-prev-unread-group (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5539 "Go to previous N'th unread newsgroup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5540 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
5541 done."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5542 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5543 (gnus-group-next-unread-group (- n)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5544
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5545 (defun gnus-group-next-unread-group-same-level (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5546 "Go to next N'th unread newsgroup on the same level.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5547 If N is negative, search backward instead.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5548 Returns the difference between N and the number of skips actually
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5549 done."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5550 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5551 (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
5552 (gnus-group-position-point))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5553
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5554 (defun gnus-group-prev-unread-group-same-level (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5555 "Go to next N'th unread newsgroup on the same level.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5556 Returns the difference between N and the number of skips actually
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5557 done."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5558 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5559 (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
5560 (gnus-group-position-point))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5561
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5562 (defun gnus-group-best-unread-group (&optional exclude-group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5563 "Go to the group with the highest level.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5564 If EXCLUDE-GROUP, do not go to that group."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5565 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5566 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5567 (let ((best 100000)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5568 unread best-point)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5569 (while (not (eobp))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5570 (setq unread (get-text-property (point) 'gnus-unread))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5571 (if (and (numberp unread) (> unread 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5572 (progn
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5573 (if (and (get-text-property (point) 'gnus-level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5574 (< (get-text-property (point) 'gnus-level) best)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5575 (or (not exclude-group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5576 (not (equal exclude-group (gnus-group-group-name)))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5577 (progn
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5578 (setq best (get-text-property (point) 'gnus-level))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5579 (setq best-point (point))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5580 (forward-line 1))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5581 (if best-point (goto-char best-point))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5582 (gnus-summary-position-point)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5583 (and best-point (gnus-group-group-name))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5584
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5585 (defun gnus-group-first-unread-group ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5586 "Go to the first group with unread articles."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5587 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5588 (prog1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5589 (let ((opoint (point))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5590 unread)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5591 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5592 (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
5593 (and (numberp unread) ; Not a topic.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5594 (not (zerop unread))) ; Has unread articles.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5595 (zerop (gnus-group-next-unread-group 1))) ; Next unread group.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5596 (point) ; Success.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5597 (goto-char opoint)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5598 nil)) ; Not success.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5599 (gnus-group-position-point)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5600
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5601 (defun gnus-group-enter-server-mode ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5602 "Jump to the server buffer."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5603 (interactive)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5604 (gnus-enter-server-buffer))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5605
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5606 (defun gnus-group-make-group (name &optional method address)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5607 "Add a new newsgroup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5608 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
5609 ADDRESS."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5610 (interactive
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5611 (cons
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5612 (read-string "Group name: ")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5613 (let ((method
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5614 (completing-read
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5615 "Method: " (append gnus-valid-select-methods gnus-server-alist)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5616 nil t nil 'gnus-method-history)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5617 (cond ((assoc method gnus-valid-select-methods)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5618 (list method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5619 (if (memq 'prompt-address
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5620 (assoc method gnus-valid-select-methods))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5621 (read-string "Address: ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5622 "")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5623 ((assoc method gnus-server-alist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5624 (list method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5625 (t
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
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5628 (let* ((meth (and method (if address (list (intern method) address)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5629 method)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5630 (nname (if method (gnus-group-prefixed-name name meth) name))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5631 backend info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5632 (when (gnus-gethash nname gnus-newsrc-hashtb)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5633 (error "Group %s already exists" nname))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5634 ;; Subscribe to the new group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5635 (gnus-group-change-level
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5636 (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
5637 gnus-level-default-subscribed gnus-level-killed
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5638 (and (gnus-group-group-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5639 (gnus-gethash (gnus-group-group-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5640 gnus-newsrc-hashtb))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5641 t)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5642 ;; Make it active.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5643 (gnus-set-active nname (cons 1 0))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5644 (or (gnus-ephemeral-group-p name)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5645 (gnus-dribble-enter
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5646 (concat "(gnus-group-set-info '" (prin1-to-string (cdr info)) ")")))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5647 ;; Insert the line.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5648 (gnus-group-insert-group-line-info nname)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5649 (forward-line -1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5650 (gnus-group-position-point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5651
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5652 ;; Load the backend and try to make the backend create
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5653 ;; the group as well.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5654 (when (assoc (symbol-name (setq backend (car (gnus-server-get-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5655 nil meth))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5656 gnus-valid-select-methods)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5657 (require backend))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5658 (gnus-check-server meth)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5659 (and (gnus-check-backend-function 'request-create-group nname)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5660 (gnus-request-create-group nname))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5661 t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5662
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5663 (defun gnus-group-delete-group (group &optional force)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5664 "Delete the current group. Only meaningful with mail groups.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5665 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
5666 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
5667 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
5668 doing the deletion."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5669 (interactive
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5670 (list (gnus-group-group-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5671 current-prefix-arg))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5672 (or group (error "No group to rename"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5673 (or (gnus-check-backend-function 'request-delete-group group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5674 (error "This backend does not support group deletion"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5675 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5676 (if (not (gnus-yes-or-no-p
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5677 (format
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5678 "Do you really want to delete %s%s? "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5679 group (if force " and all its contents" ""))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5680 () ; Whew!
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5681 (gnus-message 6 "Deleting group %s..." group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5682 (if (not (gnus-request-delete-group group force))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5683 (gnus-error 3 "Couldn't delete group %s" group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5684 (gnus-message 6 "Deleting group %s...done" group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5685 (gnus-group-goto-group group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5686 (gnus-group-kill-group 1 t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5687 (gnus-sethash group nil gnus-active-hashtb)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5688 t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5689 (gnus-group-position-point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5690
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5691 (defun gnus-group-rename-group (group new-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5692 (interactive
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5693 (list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5694 (gnus-group-group-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5695 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5696 (or (gnus-check-backend-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5697 'request-rename-group (gnus-group-group-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5698 (error "This backend does not support renaming groups"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5699 (read-string "New group name: "))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5700
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5701 (or (gnus-check-backend-function 'request-rename-group group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5702 (error "This backend does not support renaming groups"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5703
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5704 (or group (error "No group to rename"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5705 (and (string-match "^[ \t]*$" new-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5706 (error "Not a valid group name"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5707
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5708 ;; We find the proper prefixed name.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5709 (setq new-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5710 (gnus-group-prefixed-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5711 (gnus-group-real-name new-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5712 (gnus-info-method (gnus-get-info group))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5713
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5714 (gnus-message 6 "Renaming group %s to %s..." group new-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5715 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5716 (if (not (gnus-request-rename-group group new-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5717 (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
5718 ;; We rename the group internally by killing it...
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5719 (gnus-group-goto-group group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5720 (gnus-group-kill-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5721 ;; ... changing its name ...
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5722 (setcar (cdar gnus-list-of-killed-groups) new-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5723 ;; ... and then yanking it. Magic!
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5724 (gnus-group-yank-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5725 (gnus-set-active new-name (gnus-active group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5726 (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
5727 new-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5728 (gnus-group-position-point)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5729
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5730 (defun gnus-group-edit-group (group &optional part)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5731 "Edit the group on the current line."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5732 (interactive (list (gnus-group-group-name)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5733 (let* ((part (or part 'info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5734 (done-func `(lambda ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5735 "Exit editing mode and update the information."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5736 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5737 (gnus-group-edit-group-done ',part ,group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5738 (winconf (current-window-configuration))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5739 info)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5740 (or group (error "No group on current line"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5741 (or (setq info (gnus-get-info group))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5742 (error "Killed group; can't be edited"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5743 (set-buffer (get-buffer-create gnus-group-edit-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5744 (gnus-configure-windows 'edit-group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5745 (gnus-add-current-to-buffer-list)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5746 (emacs-lisp-mode)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5747 ;; Suggested by Hallvard B Furuseth <h.b.furuseth@usit.uio.no>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5748 (use-local-map (copy-keymap emacs-lisp-mode-map))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5749 (local-set-key "\C-c\C-c" done-func)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5750 (make-local-variable 'gnus-prev-winconf)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5751 (setq gnus-prev-winconf winconf)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5752 (erase-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5753 (insert
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5754 (cond
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5755 ((eq part 'method)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5756 ";; 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
5757 ((eq part 'params)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5758 ";; 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
5759 ((eq part 'info)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5760 ";; 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
5761 (insert
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5762 (pp-to-string
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5763 (cond ((eq part 'method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5764 (or (gnus-info-method info) "native"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5765 ((eq part 'params)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5766 (gnus-info-params info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5767 (t info)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5768 "\n")))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5769
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5770 (defun gnus-group-edit-group-method (group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5771 "Edit the select method of GROUP."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5772 (interactive (list (gnus-group-group-name)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5773 (gnus-group-edit-group group 'method))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5774
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5775 (defun gnus-group-edit-group-parameters (group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5776 "Edit the group parameters of GROUP."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5777 (interactive (list (gnus-group-group-name)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5778 (gnus-group-edit-group group 'params))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5779
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5780 (defun gnus-group-edit-group-done (part group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5781 "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
5782 (set-buffer (get-buffer-create gnus-group-edit-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5783 (goto-char (point-min))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5784 (let* ((form (read (current-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5785 (winconf gnus-prev-winconf)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5786 (method (cond ((eq part 'info) (nth 4 form))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5787 ((eq part 'method) form)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5788 (t nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5789 (info (cond ((eq part 'info) form)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5790 ((eq part 'method) (gnus-get-info group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5791 (t nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5792 (new-group (if info
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5793 (if (or (not method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5794 (gnus-server-equal
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5795 gnus-select-method method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5796 (gnus-group-real-name (car info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5797 (gnus-group-prefixed-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5798 (gnus-group-real-name (car info)) method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5799 nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5800 (when (and new-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5801 (not (equal new-group group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5802 (when (gnus-group-goto-group group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5803 (gnus-group-kill-group 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5804 (gnus-activate-group new-group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5805 ;; Set the info.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5806 (if (and info new-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5807 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5808 (setq info (gnus-copy-sequence info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5809 (setcar info new-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5810 (unless (gnus-server-equal method "native")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5811 (unless (nthcdr 3 info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5812 (nconc info (list nil nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5813 (unless (nthcdr 4 info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5814 (nconc info (list nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5815 (gnus-info-set-method info method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5816 (gnus-group-set-info info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5817 (gnus-group-set-info form (or new-group group) part))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5818 (kill-buffer (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5819 (and winconf (set-window-configuration winconf))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5820 (set-buffer gnus-group-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5821 (gnus-group-update-group (or new-group group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5822 (gnus-group-position-point)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5823
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5824 (defun gnus-group-make-help-group ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5825 "Create the Gnus documentation group."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5826 (interactive)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5827 (let ((path load-path)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5828 (name (gnus-group-prefixed-name "gnus-help" '(nndoc "gnus-help")))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5829 file dir)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5830 (and (gnus-gethash name gnus-newsrc-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5831 (error "Documentation group already exists"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5832 (while path
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5833 (setq dir (file-name-as-directory (expand-file-name (pop path)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5834 file nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5835 (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
5836 (file-exists-p
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5837 (setq file (concat (file-name-directory
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5838 (directory-file-name dir))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5839 "etc/gnus-tut.txt"))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5840 (setq path nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5841 (if (not file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5842 (gnus-message 1 "Couldn't find doc group")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5843 (gnus-group-make-group
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5844 (gnus-group-real-name name)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5845 (list 'nndoc "gnus-help"
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5846 (list 'nndoc-address file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5847 (list 'nndoc-article-type 'mbox)))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5848 (gnus-group-position-point))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5849
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5850 (defun gnus-group-make-doc-group (file type)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5851 "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
5852 (interactive
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5853 (list (read-file-name "File name: ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5854 (and current-prefix-arg 'ask)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5855 (when (eq type 'ask)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5856 (let ((err "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5857 char found)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5858 (while (not found)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5859 (message
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5860 "%sFile type (mbox, babyl, digest, forward, mmfd, guess) [mbdfag]: "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5861 err)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5862 (setq found (cond ((= (setq char (read-char)) ?m) 'mbox)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5863 ((= char ?b) 'babyl)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5864 ((= char ?d) 'digest)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5865 ((= char ?f) 'forward)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5866 ((= char ?a) 'mmfd)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5867 (t (setq err (format "%c unknown. " char))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5868 nil))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5869 (setq type found)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5870 (let* ((file (expand-file-name file))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5871 (name (gnus-generate-new-group-name
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5872 (gnus-group-prefixed-name
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5873 (file-name-nondirectory file) '(nndoc "")))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5874 (gnus-group-make-group
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5875 (gnus-group-real-name name)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5876 (list 'nndoc (file-name-nondirectory file)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5877 (list 'nndoc-address file)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5878 (list 'nndoc-article-type (or type 'guess))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5879
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5880 (defun gnus-group-make-archive-group (&optional all)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5881 "Create the (ding) Gnus archive group of the most recent articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5882 Given a prefix, create a full group."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5883 (interactive "P")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5884 (let ((group (gnus-group-prefixed-name
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5885 (if all "ding.archives" "ding.recent") '(nndir ""))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5886 (and (gnus-gethash group gnus-newsrc-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5887 (error "Archive group already exists"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5888 (gnus-group-make-group
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5889 (gnus-group-real-name group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5890 (list 'nndir (if all "hpc" "edu")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5891 (list 'nndir-directory
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5892 (if all gnus-group-archive-directory
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5893 gnus-group-recent-archive-directory))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5894
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5895 (defun gnus-group-make-directory-group (dir)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5896 "Create an nndir group.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5897 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
5898 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
5899 mail messages or news articles in files that have numeric names."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5900 (interactive
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5901 (list (read-file-name "Create group from directory: ")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5902 (or (file-exists-p dir) (error "No such directory"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5903 (or (file-directory-p dir) (error "Not a directory"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5904 (let ((ext "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5905 (i 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5906 group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5907 (while (or (not group) (gnus-gethash group gnus-newsrc-hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5908 (setq group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5909 (gnus-group-prefixed-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5910 (concat (file-name-as-directory (directory-file-name dir))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5911 ext)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5912 '(nndir "")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5913 (setq ext (format "<%d>" (setq i (1+ i)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5914 (gnus-group-make-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5915 (gnus-group-real-name group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5916 (list 'nndir group (list 'nndir-directory dir)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5917
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5918 (defun gnus-group-make-kiboze-group (group address scores)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5919 "Create an nnkiboze group.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5920 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
5921 score file entries for articles to include in the group."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5922 (interactive
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5923 (list
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5924 (read-string "nnkiboze group name: ")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5925 (read-string "Source groups (regexp): ")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5926 (let ((headers (mapcar (lambda (group) (list group))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5927 '("subject" "from" "number" "date" "message-id"
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5928 "references" "chars" "lines" "xref"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5929 "followup" "all" "body" "head")))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5930 scores header regexp regexps)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5931 (while (not (equal "" (setq header (completing-read
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5932 "Match on header: " headers nil t))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5933 (setq regexps nil)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5934 (while (not (equal "" (setq regexp (read-string
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5935 (format "Match on %s (string): "
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5936 header)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5937 (setq regexps (cons (list regexp nil nil 'r) regexps)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5938 (setq scores (cons (cons header regexps) scores)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5939 scores)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5940 (gnus-group-make-group group "nnkiboze" address)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5941 (nnheader-temp-write (gnus-score-file-name (concat "nnkiboze:" group))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5942 (let (emacs-lisp-mode-hook)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5943 (pp scores (current-buffer)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5944
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5945 (defun gnus-group-add-to-virtual (n vgroup)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5946 "Add the current group to a virtual group."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5947 (interactive
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5948 (list current-prefix-arg
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5949 (completing-read "Add to virtual group: " gnus-newsrc-hashtb nil t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5950 "nnvirtual:")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5951 (or (eq (car (gnus-find-method-for-group vgroup)) 'nnvirtual)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5952 (error "%s is not an nnvirtual group" vgroup))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5953 (let* ((groups (gnus-group-process-prefix n))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5954 (method (gnus-info-method (gnus-get-info vgroup))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5955 (setcar (cdr method)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5956 (concat
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5957 (nth 1 method) "\\|"
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5958 (mapconcat
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5959 (lambda (s)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5960 (gnus-group-remove-mark s)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5961 (concat "\\(^" (regexp-quote s) "$\\)"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5962 groups "\\|"))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5963 (gnus-group-position-point))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5964
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5965 (defun gnus-group-make-empty-virtual (group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5966 "Create a new, fresh, empty virtual group."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5967 (interactive "sCreate new, empty virtual group: ")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5968 (let* ((method (list 'nnvirtual "^$"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5969 (pgroup (gnus-group-prefixed-name group method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5970 ;; Check whether it exists already.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5971 (and (gnus-gethash pgroup gnus-newsrc-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5972 (error "Group %s already exists." pgroup))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5973 ;; Subscribe the new group after the group on the current line.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5974 (gnus-subscribe-group pgroup (gnus-group-group-name) method)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5975 (gnus-group-update-group pgroup)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5976 (forward-line -1)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5977 (gnus-group-position-point)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5978
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5979 (defun gnus-group-enter-directory (dir)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5980 "Enter an ephemeral nneething group."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5981 (interactive "DDirectory to read: ")
15915
cba4fbcb4aa0 (gnus-group-enter-directory): Virtual server definition
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15914
diff changeset
5982 (let* ((method (list 'nneething dir '(nneething-read-only t)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5983 (leaf (gnus-group-prefixed-name
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5984 (file-name-nondirectory (directory-file-name dir))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5985 method))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5986 (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
5987 (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
5988 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
5989 (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
5990 (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
5991 '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
5992 (error "Couldn't enter %s" dir))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5993
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5994 ;; Group sorting commands
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5995 ;; Suggested by Joe Hildebrand <hildjj@idaho.fuentez.com>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5996
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5997 (defun gnus-group-sort-groups (func &optional reverse)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5998 "Sort the group buffer according to FUNC.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5999 If REVERSE, reverse the sorting order."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6000 (interactive (list gnus-group-sort-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6001 current-prefix-arg))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6002 (let ((func (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6003 ((not (listp func)) func)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6004 ((null func) func)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6005 ((= 1 (length func)) (car func))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6006 (t `(lambda (t1 t2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6007 ,(gnus-make-sort-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6008 (reverse func)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6009 ;; We peel off the dummy group from the alist.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6010 (when func
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6011 (when (equal (car (gnus-info-group gnus-newsrc-alist)) "dummy.group")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6012 (pop gnus-newsrc-alist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6013 ;; Do the sorting.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6014 (setq gnus-newsrc-alist
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6015 (sort gnus-newsrc-alist func))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6016 (when reverse
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6017 (setq gnus-newsrc-alist (nreverse gnus-newsrc-alist)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6018 ;; Regenerate the hash table.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6019 (gnus-make-hashtable-from-newsrc-alist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6020 (gnus-group-list-groups))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6021
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6022 (defun gnus-group-sort-groups-by-alphabet (&optional reverse)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6023 "Sort the group buffer alphabetically by group name.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6024 If REVERSE, sort in reverse order."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6025 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6026 (gnus-group-sort-groups 'gnus-group-sort-by-alphabet reverse))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6027
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6028 (defun gnus-group-sort-groups-by-unread (&optional reverse)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6029 "Sort the group buffer by number of unread articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6030 If REVERSE, sort in reverse order."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6031 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6032 (gnus-group-sort-groups 'gnus-group-sort-by-unread reverse))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6033
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6034 (defun gnus-group-sort-groups-by-level (&optional reverse)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6035 "Sort the group buffer by group level.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6036 If REVERSE, sort in reverse order."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6037 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6038 (gnus-group-sort-groups 'gnus-group-sort-by-level reverse))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6039
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6040 (defun gnus-group-sort-groups-by-score (&optional reverse)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6041 "Sort the group buffer by group score.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6042 If REVERSE, sort in reverse order."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6043 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6044 (gnus-group-sort-groups 'gnus-group-sort-by-score reverse))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6045
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6046 (defun gnus-group-sort-groups-by-rank (&optional reverse)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6047 "Sort the group buffer by group rank.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6048 If REVERSE, sort in reverse order."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6049 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6050 (gnus-group-sort-groups 'gnus-group-sort-by-rank reverse))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6051
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6052 (defun gnus-group-sort-groups-by-method (&optional reverse)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6053 "Sort the group buffer alphabetically by backend name.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6054 If REVERSE, sort in reverse order."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6055 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6056 (gnus-group-sort-groups 'gnus-group-sort-by-method reverse))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6057
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6058 (defun gnus-group-sort-by-alphabet (info1 info2)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6059 "Sort alphabetically."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6060 (string< (gnus-info-group info1) (gnus-info-group info2)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6061
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6062 (defun gnus-group-sort-by-unread (info1 info2)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6063 "Sort by number of unread articles."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6064 (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
6065 (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
6066 (< (or (and (numberp n1) n1) 0)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6067 (or (and (numberp n2) n2) 0))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6068
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6069 (defun gnus-group-sort-by-level (info1 info2)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6070 "Sort by level."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6071 (< (gnus-info-level info1) (gnus-info-level info2)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6072
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6073 (defun gnus-group-sort-by-method (info1 info2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6074 "Sort alphabetically by backend name."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6075 (string< (symbol-name (car (gnus-find-method-for-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6076 (gnus-info-group info1) info1)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6077 (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 info2) info2)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6079
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6080 (defun gnus-group-sort-by-score (info1 info2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6081 "Sort by group score."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6082 (< (gnus-info-score info1) (gnus-info-score info2)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6083
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6084 (defun gnus-group-sort-by-rank (info1 info2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6085 "Sort by level and score."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6086 (let ((level1 (gnus-info-level info1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6087 (level2 (gnus-info-level info2)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6088 (or (< level1 level2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6089 (and (= level1 level2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6090 (> (gnus-info-score info1) (gnus-info-score info2))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6091
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6092 ;; Group catching up.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6093
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6094 (defun gnus-group-clear-data (n)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6095 "Clear all marks and read ranges from the current group."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6096 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6097 (let ((groups (gnus-group-process-prefix n))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6098 group info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6099 (while (setq group (pop groups))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6100 (setq info (gnus-get-info group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6101 (gnus-info-set-read info nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6102 (when (gnus-info-marks info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6103 (gnus-info-set-marks info nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6104 (gnus-get-unread-articles-in-group info (gnus-active group) t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6105 (when (gnus-group-goto-group group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6106 (gnus-group-remove-mark group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6107 (gnus-group-update-group-line)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6108
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6109 (defun gnus-group-catchup-current (&optional n all)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6110 "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
6111 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
6112 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
6113 read. Cross references (Xref: header) of articles are ignored.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6114 The difference between N and actual number of newsgroups that were
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6115 caught up is returned."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6116 (interactive "P")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6117 (unless (gnus-group-group-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6118 (error "No group on the current line"))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6119 (if (not (or (not gnus-interactive-catchup) ;Without confirmation?
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6120 gnus-expert-user
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6121 (gnus-y-or-n-p
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6122 (if all
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6123 "Do you really want to mark all articles as read? "
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6124 "Mark all unread articles as read? "))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6125 n
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6126 (let ((groups (gnus-group-process-prefix n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6127 (ret 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6128 (while groups
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6129 ;; Virtual groups have to be given special treatment.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6130 (let ((method (gnus-find-method-for-group (car groups))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6131 (if (eq 'nnvirtual (car method))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6132 (nnvirtual-catchup-group
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6133 (gnus-group-real-name (car groups)) (nth 1 method) all)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6134 (gnus-group-remove-mark (car groups))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6135 (if (>= (gnus-group-group-level) gnus-level-zombie)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6136 (gnus-message 2 "Dead groups can't be caught up")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6137 (if (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6138 (gnus-group-goto-group (car groups))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6139 (gnus-group-catchup (car groups) all))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6140 (gnus-group-update-group-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6141 (setq ret (1+ ret))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6142 (setq groups (cdr groups)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6143 (gnus-group-next-unread-group 1)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6144 ret)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6145
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6146 (defun gnus-group-catchup-current-all (&optional n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6147 "Mark all articles in current newsgroup as read.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6148 Cross references (Xref: header) of articles are ignored."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6149 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6150 (gnus-group-catchup-current n 'all))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6151
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6152 (defun gnus-group-catchup (group &optional all)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6153 "Mark all articles in GROUP as read.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6154 If ALL is non-nil, all articles are marked as read.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6155 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
6156 or nil if no action could be taken."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6157 (let* ((entry (gnus-gethash group gnus-newsrc-hashtb))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6158 (num (car entry)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6159 ;; Do the updating only if the newsgroup isn't killed.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6160 (if (not (numberp (car entry)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6161 (gnus-message 1 "Can't catch up; non-active group")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6162 ;; Do auto-expirable marks if that's required.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6163 (when (gnus-group-auto-expirable-p group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6164 (gnus-add-marked-articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6165 group 'expire (gnus-list-of-unread-articles group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6166 (when all
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6167 (let ((marks (nth 3 (nth 2 entry))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6168 (gnus-add-marked-articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6169 group 'expire (gnus-uncompress-range (cdr (assq 'tick marks))))
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 (when entry
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6173 (gnus-update-read-articles group nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6174 ;; Also nix out the lists of marks and dormants.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6175 (when all
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6176 (gnus-add-marked-articles group 'tick nil nil 'force)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6177 (gnus-add-marked-articles group 'dormant nil nil 'force))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6178 (run-hooks 'gnus-group-catchup-group-hook)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6179 num))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6180
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6181 (defun gnus-group-expire-articles (&optional n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6182 "Expire all expirable articles in the current newsgroup."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6183 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6184 (let ((groups (gnus-group-process-prefix n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6185 group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6186 (unless groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6187 (error "No groups to expire"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6188 (while (setq group (pop groups))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6189 (gnus-group-remove-mark group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6190 (when (gnus-check-backend-function 'request-expire-articles group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6191 (gnus-message 6 "Expiring articles in %s..." group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6192 (let* ((info (gnus-get-info group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6193 (expirable (if (gnus-group-total-expirable-p group)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6194 (cons nil (gnus-list-of-read-articles group))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6195 (assq 'expire (gnus-info-marks info))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6196 (expiry-wait (gnus-group-get-parameter group 'expiry-wait)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6197 (when expirable
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6198 (setcdr
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6199 expirable
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6200 (gnus-compress-sequence
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6201 (if expiry-wait
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6202 ;; We set the expiry variables to the groupp
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6203 ;; parameter.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6204 (let ((nnmail-expiry-wait-function nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6205 (nnmail-expiry-wait expiry-wait))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6206 (gnus-request-expire-articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6207 (gnus-uncompress-sequence (cdr expirable)) group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6208 ;; Just expire using the normal expiry values.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6209 (gnus-request-expire-articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6210 (gnus-uncompress-sequence (cdr expirable)) group))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6211 (gnus-close-group group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6212 (gnus-message 6 "Expiring articles in %s...done" group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6213 (gnus-group-position-point))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6214
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6215 (defun gnus-group-expire-all-groups ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6216 "Expire all expirable articles in all newsgroups."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6217 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6218 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6219 (gnus-message 5 "Expiring...")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6220 (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
6221 (cdr gnus-newsrc-alist))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6222 (gnus-group-expire-articles nil)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6223 (gnus-group-position-point)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6224 (gnus-message 5 "Expiring...done"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6225
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6226 (defun gnus-group-set-current-level (n level)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6227 "Set the level of the next N groups to LEVEL."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6228 (interactive
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6229 (list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6230 current-prefix-arg
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6231 (string-to-int
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6232 (let ((s (read-string
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6233 (format "Level (default %s): "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6234 (or (gnus-group-group-level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6235 gnus-level-default-subscribed)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6236 (if (string-match "^\\s-*$" s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6237 (int-to-string (or (gnus-group-group-level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6238 gnus-level-default-subscribed))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6239 s)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6240 (or (and (>= level 1) (<= level gnus-level-killed))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6241 (error "Illegal level: %d" level))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6242 (let ((groups (gnus-group-process-prefix n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6243 group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6244 (while (setq group (pop groups))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6245 (gnus-group-remove-mark group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6246 (gnus-message 6 "Changed level of %s from %d to %d"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6247 group (or (gnus-group-group-level) gnus-level-killed)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6248 level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6249 (gnus-group-change-level
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6250 group level (or (gnus-group-group-level) gnus-level-killed))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6251 (gnus-group-update-group-line)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6252 (gnus-group-position-point))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6253
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6254 (defun gnus-group-unsubscribe-current-group (&optional n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6255 "Toggle subscription of the current group.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6256 If given numerical prefix, toggle the N next groups."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6257 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6258 (let ((groups (gnus-group-process-prefix n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6259 group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6260 (while groups
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6261 (setq group (car groups)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6262 groups (cdr groups))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6263 (gnus-group-remove-mark group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6264 (gnus-group-unsubscribe-group
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6265 group (if (<= (gnus-group-group-level) gnus-level-subscribed)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6266 gnus-level-default-unsubscribed
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6267 gnus-level-default-subscribed) t)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6268 (gnus-group-update-group-line))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6269 (gnus-group-next-group 1)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6270
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6271 (defun gnus-group-unsubscribe-group (group &optional level silent)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6272 "Toggle subscription to GROUP.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6273 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
6274 group line."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6275 (interactive
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6276 (list (completing-read
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6277 "Group: " gnus-active-hashtb nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6278 (gnus-read-active-file-p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6279 nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6280 'gnus-group-history)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6281 (let ((newsrc (gnus-gethash group gnus-newsrc-hashtb)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6282 (cond
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6283 ((string-match "^[ \t]$" group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6284 (error "Empty group name"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6285 (newsrc
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6286 ;; Toggle subscription flag.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6287 (gnus-group-change-level
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6288 newsrc (if level level (if (<= (nth 1 (nth 2 newsrc))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6289 gnus-level-subscribed)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6290 (1+ gnus-level-subscribed)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6291 gnus-level-default-subscribed)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6292 (unless silent
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6293 (gnus-group-update-group group)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6294 ((and (stringp group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6295 (or (not (gnus-read-active-file-p))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6296 (gnus-active group)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6297 ;; Add new newsgroup.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6298 (gnus-group-change-level
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6299 group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6300 (if level level gnus-level-default-subscribed)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6301 (or (and (member group gnus-zombie-list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6302 gnus-level-zombie)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6303 gnus-level-killed)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6304 (and (gnus-group-group-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6305 (gnus-gethash (gnus-group-group-name) gnus-newsrc-hashtb)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6306 (unless silent
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6307 (gnus-group-update-group group)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6308 (t (error "No such newsgroup: %s" group)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6309 (gnus-group-position-point)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6310
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6311 (defun gnus-group-transpose-groups (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6312 "Move the current newsgroup up N places.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6313 If given a negative prefix, move down instead. The difference between
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6314 N and the number of steps taken is returned."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6315 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6316 (or (gnus-group-group-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6317 (error "No group on current line"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6318 (gnus-group-kill-group 1)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6319 (prog1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6320 (forward-line (- n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6321 (gnus-group-yank-group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6322 (gnus-group-position-point)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6323
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6324 (defun gnus-group-kill-all-zombies ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6325 "Kill all zombie newsgroups."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6326 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6327 (setq gnus-killed-list (nconc gnus-zombie-list gnus-killed-list))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6328 (setq gnus-zombie-list nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6329 (gnus-group-list-groups))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6330
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6331 (defun gnus-group-kill-region (begin end)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6332 "Kill newsgroups in current region (excluding current point).
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6333 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
6334 (interactive "r")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6335 (let ((lines
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6336 ;; Count lines.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6337 (save-excursion
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 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6340 (goto-char begin)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6341 (beginning-of-line)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6342 (point))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6343 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6344 (goto-char end)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6345 (beginning-of-line)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6346 (point))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6347 (goto-char begin)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6348 (beginning-of-line) ;Important when LINES < 1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6349 (gnus-group-kill-group lines)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6350
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6351 (defun gnus-group-kill-group (&optional n discard)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6352 "Kill the next N groups.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6353 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
6354 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
6355 groups or zombie groups can't be yanked.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6356 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
6357 of groups killed."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6358 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6359 (let ((buffer-read-only nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6360 (groups (gnus-group-process-prefix n))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6361 group entry level out)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6362 (if (< (length groups) 10)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6363 ;; This is faster when there are few groups.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6364 (while groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6365 (push (setq group (pop groups)) out)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6366 (gnus-group-remove-mark group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6367 (setq level (gnus-group-group-level))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6368 (gnus-delete-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6369 (when (and (not discard)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6370 (setq entry (gnus-gethash group gnus-newsrc-hashtb)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6371 (push (cons (car entry) (nth 2 entry))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6372 gnus-list-of-killed-groups))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6373 (gnus-group-change-level
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6374 (if entry entry group) gnus-level-killed (if entry nil level)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6375 ;; 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
6376 ;; this thing instead.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6377 (let (entry)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6378 (setq groups (nreverse groups))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6379 (while groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6380 (gnus-group-remove-mark (setq group (pop groups)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6381 (gnus-delete-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6382 (push group gnus-killed-list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6383 (setq gnus-newsrc-alist
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6384 (delq (assoc group gnus-newsrc-alist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6385 gnus-newsrc-alist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6386 (when gnus-group-change-level-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6387 (funcall gnus-group-change-level-function group 9 3))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6388 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6389 ((setq entry (gnus-gethash group gnus-newsrc-hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6390 (push (cons (car entry) (nth 2 entry))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6391 gnus-list-of-killed-groups)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6392 (setcdr (cdr entry) (cdddr entry)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6393 ((member group gnus-zombie-list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6394 (setq gnus-zombie-list (delete group gnus-zombie-list)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6395 (gnus-make-hashtable-from-newsrc-alist)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6396
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6397 (gnus-group-position-point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6398 (if (< (length out) 2) (car out) (nreverse out))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6399
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6400 (defun gnus-group-yank-group (&optional arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6401 "Yank the last newsgroups killed with \\[gnus-group-kill-group],
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6402 inserting it before the current newsgroup. The numeric ARG specifies
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6403 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
6404 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
6405 is returned."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6406 (interactive "p")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6407 (setq arg (or arg 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6408 (let (info group prev out)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6409 (while (>= (decf arg) 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6410 (if (not (setq info (pop gnus-list-of-killed-groups)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6411 (error "No more newsgroups to yank"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6412 (push (setq group (nth 1 info)) out)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6413 ;; Find which newsgroup to insert this one before - search
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6414 ;; backward until something suitable is found. If there are no
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6415 ;; other newsgroups in this buffer, just make this newsgroup the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6416 ;; first newsgroup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6417 (setq prev (gnus-group-group-name))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6418 (gnus-group-change-level
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6419 info (gnus-info-level (cdr info)) gnus-level-killed
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6420 (and prev (gnus-gethash prev gnus-newsrc-hashtb))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6421 t)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6422 (gnus-group-insert-group-line-info group))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6423 (forward-line -1)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6424 (gnus-group-position-point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6425 (if (< (length out) 2) (car out) (nreverse out))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6426
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6427 (defun gnus-group-kill-level (level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6428 "Kill all groups that is on a certain LEVEL."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6429 (interactive "nKill all groups on level: ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6430 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6431 ((= level gnus-level-zombie)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6432 (setq gnus-killed-list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6433 (nconc gnus-zombie-list gnus-killed-list))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6434 (setq gnus-zombie-list nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6435 ((and (< level gnus-level-zombie)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6436 (> level 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6437 (or gnus-expert-user
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6438 (gnus-yes-or-no-p
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6439 (format
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6440 "Do you really want to kill all groups on level %d? "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6441 level))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6442 (let* ((prev gnus-newsrc-alist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6443 (alist (cdr prev)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6444 (while alist
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
6445 (if (= (gnus-info-level (car alist)) level)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
6446 (progn
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
6447 (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
6448 (setcdr prev (cdr alist)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6449 (setq prev alist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6450 (setq alist (cdr alist)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6451 (gnus-make-hashtable-from-newsrc-alist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6452 (gnus-group-list-groups)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6453 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6454 (error "Can't kill; illegal level: %d" level))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6455
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6456 (defun gnus-group-list-all-groups (&optional arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6457 "List all newsgroups with level ARG or lower.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6458 Default is gnus-level-unsubscribed, which lists all subscribed and most
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6459 unsubscribed groups."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6460 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6461 (gnus-group-list-groups (or arg gnus-level-unsubscribed) t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6462
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6463 ;; Redefine this to list ALL killed groups if prefix arg used.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6464 ;; Rewritten by engstrom@src.honeywell.com (Eric Engstrom).
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6465 (defun gnus-group-list-killed (&optional arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6466 "List all killed newsgroups in the group buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6467 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
6468 entail asking the server for the groups."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6469 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6470 ;; Find all possible killed newsgroups if arg.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6471 (when arg
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6472 (gnus-get-killed-groups))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6473 (if (not gnus-killed-list)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6474 (gnus-message 6 "No killed groups")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6475 (let (gnus-group-list-mode)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6476 (funcall gnus-group-prepare-function
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6477 gnus-level-killed t gnus-level-killed))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6478 (goto-char (point-min)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6479 (gnus-group-position-point))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6480
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6481 (defun gnus-group-list-zombies ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6482 "List all zombie newsgroups in the group buffer."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6483 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6484 (if (not gnus-zombie-list)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6485 (gnus-message 6 "No zombie groups")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6486 (let (gnus-group-list-mode)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6487 (funcall gnus-group-prepare-function
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6488 gnus-level-zombie t gnus-level-zombie))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6489 (goto-char (point-min)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6490 (gnus-group-position-point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6491
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6492 (defun gnus-group-list-active ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6493 "List all groups that are available from the server(s)."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6494 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6495 ;; 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
6496 (unless (gnus-read-active-file-p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6497 (let ((gnus-read-active-file t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6498 (gnus-read-active-file)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6499 ;; Find all groups and sort them.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6500 (let ((groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6501 (sort
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6502 (let (list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6503 (mapatoms
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6504 (lambda (sym)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6505 (and (boundp sym)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6506 (symbol-value sym)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6507 (setq list (cons (symbol-name sym) list))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6508 gnus-active-hashtb)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6509 list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6510 'string<))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6511 (buffer-read-only nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6512 (erase-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6513 (while groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6514 (gnus-group-insert-group-line-info (pop groups)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6515 (goto-char (point-min))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6516
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6517 (defun gnus-activate-all-groups (level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6518 "Activate absolutely all groups."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6519 (interactive (list 7))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6520 (let ((gnus-activate-level level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6521 (gnus-activate-foreign-newsgroups level))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6522 (gnus-group-get-new-news)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6523
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6524 (defun gnus-group-get-new-news (&optional arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6525 "Get newly arrived articles.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6526 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
6527 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
6528 \"hard\" re-reading of the active files from all servers."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6529 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6530 (run-hooks 'gnus-get-new-news-hook)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6531 ;; We might read in new NoCeM messages here.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6532 (when (and gnus-use-nocem
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6533 (null arg))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6534 (gnus-nocem-scan-groups))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6535 ;; 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
6536 (when (and arg (not (numberp arg)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6537 (let ((gnus-read-active-file t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6538 (gnus-read-active-file))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6539 (setq arg nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6540
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6541 (setq arg (gnus-group-default-level arg t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6542 (if (and gnus-read-active-file (not arg))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6543 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6544 (gnus-read-active-file)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6545 (gnus-get-unread-articles arg))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6546 (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
6547 (gnus-get-unread-articles arg)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6548 (run-hooks 'gnus-after-getting-new-news-hook)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6549 (gnus-group-list-groups))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6550
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6551 (defun gnus-group-get-new-news-this-group (&optional n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6552 "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
6553 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
6554 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
6555 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6556 (let* ((groups (gnus-group-process-prefix n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6557 (ret (if (numberp n) (- n (length groups)) 0))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6558 (beg (unless n (point)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6559 group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6560 (while (setq group (pop groups))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6561 (gnus-group-remove-mark group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6562 (if (gnus-activate-group group 'scan)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6563 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6564 (gnus-get-unread-articles-in-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6565 (gnus-get-info group) (gnus-active group) t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6566 (unless (gnus-virtual-group-p group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6567 (gnus-close-group group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6568 (gnus-group-update-group group))
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
6569 (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
6570 'denied)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
6571 (gnus-error "Server denied access")
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
6572 (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
6573 (when beg (goto-char beg))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6574 (when gnus-goto-next-group-when-activating
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6575 (gnus-group-next-unread-group 1 t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6576 (gnus-summary-position-point)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6577 ret))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6578
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6579 (defun gnus-group-fetch-faq (group &optional faq-dir)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6580 "Fetch the FAQ for the current group."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6581 (interactive
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6582 (list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6583 (and (gnus-group-group-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6584 (gnus-group-real-name (gnus-group-group-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6585 (cond (current-prefix-arg
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6586 (completing-read
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6587 "Faq dir: " (and (listp gnus-group-faq-directory)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6588 (mapcar (lambda (file) (list file))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6589 gnus-group-faq-directory)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6590 (or faq-dir
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6591 (setq faq-dir (if (listp gnus-group-faq-directory)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6592 (car gnus-group-faq-directory)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6593 gnus-group-faq-directory)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6594 (or group (error "No group name given"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6595 (let ((file (concat (file-name-as-directory faq-dir)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6596 (gnus-group-real-name group))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6597 (if (not (file-exists-p file))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6598 (error "No such file: %s" file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6599 (find-file file))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6600
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6601 (defun gnus-group-describe-group (force &optional group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6602 "Display a description of the current newsgroup."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6603 (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
6604 (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
6605 (mname (gnus-group-prefixed-name "" method))
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
6606 desc)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
6607 (when (and force
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
6608 gnus-description-hashtb)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
6609 (gnus-sethash mname nil gnus-description-hashtb))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6610 (or group (error "No group name given"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6611 (and (or (and gnus-description-hashtb
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6612 ;; We check whether this group's method has been
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6613 ;; queried for a description file.
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
6614 (gnus-gethash mname gnus-description-hashtb))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6615 (setq desc (gnus-group-get-description group))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6616 (gnus-read-descriptions-file method))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6617 (gnus-message 1
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6618 (or desc (gnus-gethash group gnus-description-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6619 "No description available")))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6620
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6621 ;; Suggested by Per Abrahamsen <amanda@iesd.auc.dk>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6622 (defun gnus-group-describe-all-groups (&optional force)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6623 "Pop up a buffer with descriptions of all newsgroups."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6624 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6625 (and force (setq gnus-description-hashtb nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6626 (if (not (or gnus-description-hashtb
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6627 (gnus-read-all-descriptions-files)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6628 (error "Couldn't request descriptions file"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6629 (let ((buffer-read-only nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6630 b)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6631 (erase-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6632 (mapatoms
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6633 (lambda (group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6634 (setq b (point))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6635 (insert (format " *: %-20s %s\n" (symbol-name group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6636 (symbol-value group)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6637 (gnus-add-text-properties
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6638 b (1+ b) (list 'gnus-group group
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6639 'gnus-unread t 'gnus-marked nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6640 'gnus-level (1+ gnus-level-subscribed))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6641 gnus-description-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6642 (goto-char (point-min))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6643 (gnus-group-position-point)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6644
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6645 ;; Suggested by by Daniel Quinlan <quinlan@best.com>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6646 (defun gnus-group-apropos (regexp &optional search-description)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6647 "List all newsgroups that have names that match a regexp."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6648 (interactive "sGnus apropos (regexp): ")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6649 (let ((prev "")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6650 (obuf (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6651 groups des)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6652 ;; Go through all newsgroups that are known to Gnus.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6653 (mapatoms
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6654 (lambda (group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6655 (and (symbol-name group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6656 (string-match regexp (symbol-name group))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6657 (setq groups (cons (symbol-name group) groups))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6658 gnus-active-hashtb)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6659 ;; Also go through all descriptions that are known to Gnus.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6660 (when search-description
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6661 (mapatoms
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6662 (lambda (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6663 (and (string-match regexp (symbol-value group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6664 (gnus-active (symbol-name group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6665 (setq groups (cons (symbol-name group) groups))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6666 gnus-description-hashtb))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6667 (if (not groups)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6668 (gnus-message 3 "No groups matched \"%s\"." regexp)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6669 ;; Print out all the groups.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6670 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6671 (pop-to-buffer "*Gnus Help*")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6672 (buffer-disable-undo (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6673 (erase-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6674 (setq groups (sort groups 'string<))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6675 (while groups
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6676 ;; Groups may be entered twice into the list of groups.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6677 (if (not (string= (car groups) prev))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6678 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6679 (insert (setq prev (car groups)) "\n")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6680 (if (and gnus-description-hashtb
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6681 (setq des (gnus-gethash (car groups)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6682 gnus-description-hashtb)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6683 (insert " " des "\n"))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6684 (setq groups (cdr groups)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6685 (goto-char (point-min))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6686 (pop-to-buffer obuf)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6687
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6688 (defun gnus-group-description-apropos (regexp)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6689 "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
6690 (interactive "sGnus description apropos (regexp): ")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6691 (if (not (or gnus-description-hashtb
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6692 (gnus-read-all-descriptions-files)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6693 (error "Couldn't request descriptions file"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6694 (gnus-group-apropos regexp t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6695
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6696 ;; Suggested by Per Abrahamsen <amanda@iesd.auc.dk>.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6697 (defun gnus-group-list-matching (level regexp &optional all lowest)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6698 "List all groups with unread articles that match REGEXP.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6699 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
6700 level to cut off listing groups.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6701 If ALL, also list groups with no unread articles.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6702 If LOWEST, don't list groups with level lower than LOWEST.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6703
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6704 This command may read the active file."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6705 (interactive "P\nsList newsgroups matching: ")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6706 ;; First make sure active file has been read.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6707 (when (and level
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6708 (> (prefix-numeric-value level) gnus-level-killed))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6709 (gnus-get-killed-groups))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6710 (gnus-group-prepare-flat (or level gnus-level-subscribed)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6711 all (or lowest 1) regexp)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6712 (goto-char (point-min))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6713 (gnus-group-position-point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6714
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6715 (defun gnus-group-list-all-matching (level regexp &optional lowest)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6716 "List all groups that match REGEXP.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6717 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
6718 level to cut off listing groups.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6719 If LOWEST, don't list groups with level lower than LOWEST."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6720 (interactive "P\nsList newsgroups matching: ")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6721 (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
6722
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6723 ;; Suggested by Jack Vinson <vinson@unagi.cis.upenn.edu>.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6724 (defun gnus-group-save-newsrc (&optional force)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6725 "Save the Gnus startup files.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6726 If FORCE, force saving whether it is necessary or not."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6727 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6728 (gnus-save-newsrc-file force))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6729
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6730 (defun gnus-group-restart (&optional arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6731 "Force Gnus to read the .newsrc file."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6732 (interactive "P")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6733 (when (gnus-yes-or-no-p
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6734 (format "Are you sure you want to read %s? "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6735 gnus-current-startup-file))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6736 (gnus-save-newsrc-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6737 (gnus-setup-news 'force)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6738 (gnus-group-list-groups arg)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6739
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6740 (defun gnus-group-read-init-file ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6741 "Read the Gnus elisp init file."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6742 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6743 (gnus-read-init-file))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6744
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6745 (defun gnus-group-check-bogus-groups (&optional silent)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6746 "Check bogus newsgroups.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6747 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
6748 group."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6749 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6750 (gnus-check-bogus-newsgroups (and (not silent) (not gnus-expert-user)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6751 (gnus-group-list-groups))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6752
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6753 (defun gnus-group-edit-global-kill (&optional article group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6754 "Edit the global kill file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6755 If GROUP, edit that local kill file instead."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6756 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6757 (setq gnus-current-kill-article article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6758 (gnus-kill-file-edit-file group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6759 (gnus-message
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6760 6
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6761 (substitute-command-keys
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6762 (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
6763 (if group "local" "global")))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6764
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6765 (defun gnus-group-edit-local-kill (article group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6766 "Edit a local kill file."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6767 (interactive (list nil (gnus-group-group-name)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6768 (gnus-group-edit-global-kill article group))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6769
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6770 (defun gnus-group-force-update ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6771 "Update `.newsrc' file."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6772 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6773 (gnus-save-newsrc-file))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6774
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6775 (defun gnus-group-suspend ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6776 "Suspend the current Gnus session.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6777 In fact, cleanup buffers except for group mode buffer.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6778 The hook gnus-suspend-gnus-hook is called before actually suspending."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6779 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6780 (run-hooks 'gnus-suspend-gnus-hook)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6781 ;; Kill Gnus buffers except for group mode buffer.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6782 (let* ((group-buf (get-buffer gnus-group-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6783 ;; 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
6784 (gnus-buffer-list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6785 (delete group-buf (delete gnus-dribble-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6786 (append gnus-buffer-list nil)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6787 (while gnus-buffer-list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6788 (gnus-kill-buffer (pop gnus-buffer-list)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6789 (gnus-kill-gnus-frames)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6790 (when group-buf
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6791 (setq gnus-buffer-list (list group-buf))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6792 (bury-buffer group-buf)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6793 (delete-windows-on group-buf t))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6794
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6795 (defun gnus-group-clear-dribble ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6796 "Clear all information from the dribble buffer."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6797 (interactive)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6798 (gnus-dribble-clear)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6799 (gnus-message 7 "Cleared dribble buffer"))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6800
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6801 (defun gnus-group-exit ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6802 "Quit reading news after updating .newsrc.eld and .newsrc.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6803 The hook `gnus-exit-gnus-hook' is called before actually exiting."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6804 (interactive)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6805 (when
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6806 (or noninteractive ;For gnus-batch-kill
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6807 (not gnus-interactive-exit) ;Without confirmation
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6808 gnus-expert-user
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6809 (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
6810 (run-hooks 'gnus-exit-gnus-hook)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6811 ;; Offer to save data from non-quitted summary buffers.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6812 (gnus-offer-save-summaries)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6813 ;; Save the newsrc file(s).
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6814 (gnus-save-newsrc-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6815 ;; Kill-em-all.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6816 (gnus-close-backends)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6817 ;; Reset everything.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6818 (gnus-clear-system)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6819 ;; Allow the user to do things after cleaning up.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6820 (run-hooks 'gnus-after-exiting-gnus-hook)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6821
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6822 (defun gnus-close-backends ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6823 ;; 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
6824 (let ((methods gnus-valid-select-methods)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6825 func)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6826 (while methods
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6827 (if (fboundp (setq func (intern (concat (caar methods)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6828 "-request-close"))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6829 (funcall func))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6830 (setq methods (cdr methods)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6831
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6832 (defun gnus-group-quit ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6833 "Quit reading news without updating .newsrc.eld or .newsrc.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6834 The hook `gnus-exit-gnus-hook' is called before actually exiting."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6835 (interactive)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6836 (when (or noninteractive ;For gnus-batch-kill
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6837 (zerop (buffer-size))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6838 (not (gnus-server-opened gnus-select-method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6839 gnus-expert-user
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6840 (not gnus-current-startup-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6841 (gnus-yes-or-no-p
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6842 (format "Quit reading news without saving %s? "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6843 (file-name-nondirectory gnus-current-startup-file))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6844 (run-hooks 'gnus-exit-gnus-hook)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6845 (if gnus-use-full-window
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6846 (delete-other-windows)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6847 (gnus-remove-some-windows))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6848 (gnus-dribble-save)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6849 (gnus-close-backends)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6850 (gnus-clear-system)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6851 ;; Allow the user to do things after cleaning up.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6852 (run-hooks 'gnus-after-exiting-gnus-hook)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6853
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6854 (defun gnus-offer-save-summaries ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6855 "Offer to save all active summary buffers."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6856 (save-excursion
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6857 (let ((buflist (buffer-list))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6858 buffers bufname)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6859 ;; Go through all buffers and find all summaries.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6860 (while buflist
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6861 (and (setq bufname (buffer-name (car buflist)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6862 (string-match "Summary" bufname)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6863 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6864 (set-buffer bufname)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6865 ;; We check that this is, indeed, a summary buffer.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6866 (and (eq major-mode 'gnus-summary-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6867 ;; Also make sure this isn't bogus.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6868 gnus-newsgroup-prepared))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6869 (push bufname buffers))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6870 (setq buflist (cdr buflist)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6871 ;; Go through all these summary buffers and offer to save them.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6872 (when buffers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6873 (map-y-or-n-p
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6874 "Update summary buffer %s? "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6875 (lambda (buf) (set-buffer buf) (gnus-summary-exit))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6876 buffers)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6877
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6878 (defun gnus-group-describe-briefly ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6879 "Give a one line description of the group mode commands."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6880 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6881 (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
6882
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6883 (defun gnus-group-browse-foreign-server (method)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6884 "Browse a foreign news server.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6885 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
6886 (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
6887 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
6888 and the second element is the address."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6889 (interactive
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6890 (list (let ((how (completing-read
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6891 "Which backend: "
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6892 (append gnus-valid-select-methods gnus-server-alist)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6893 nil t (cons "nntp" 0) 'gnus-method-history)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6894 ;; We either got a backend name or a virtual server name.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6895 ;; If the first, we also need an address.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6896 (if (assoc how gnus-valid-select-methods)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6897 (list (intern how)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6898 ;; Suggested by mapjph@bath.ac.uk.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6899 (completing-read
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6900 "Address: "
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6901 (mapcar (lambda (server) (list server))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6902 gnus-secondary-servers)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6903 ;; We got a server name, so we find the method.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6904 (gnus-server-to-method how)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6905 (gnus-browse-foreign-server method))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6906
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6907
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 ;;; Gnus summary mode
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
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6912 (defvar gnus-summary-mode-map nil)
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 (put 'gnus-summary-mode 'mode-class 'special)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6915
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6916 (unless gnus-summary-mode-map
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6917 (setq gnus-summary-mode-map (make-keymap))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6918 (suppress-keymap gnus-summary-mode-map)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6919
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6920 ;; Non-orthogonal keys
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6921
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6922 (gnus-define-keys gnus-summary-mode-map
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6923 " " gnus-summary-next-page
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6924 "\177" gnus-summary-prev-page
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6925 [delete] gnus-summary-prev-page
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6926 "\r" gnus-summary-scroll-up
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6927 "n" gnus-summary-next-unread-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6928 "p" gnus-summary-prev-unread-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6929 "N" gnus-summary-next-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6930 "P" gnus-summary-prev-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6931 "\M-\C-n" gnus-summary-next-same-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6932 "\M-\C-p" gnus-summary-prev-same-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6933 "\M-n" gnus-summary-next-unread-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6934 "\M-p" gnus-summary-prev-unread-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6935 "." gnus-summary-first-unread-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6936 "," gnus-summary-best-unread-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6937 "\M-s" gnus-summary-search-article-forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6938 "\M-r" gnus-summary-search-article-backward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6939 "<" gnus-summary-beginning-of-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6940 ">" gnus-summary-end-of-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6941 "j" gnus-summary-goto-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6942 "^" gnus-summary-refer-parent-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6943 "\M-^" gnus-summary-refer-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6944 "u" gnus-summary-tick-article-forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6945 "!" gnus-summary-tick-article-forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6946 "U" gnus-summary-tick-article-backward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6947 "d" gnus-summary-mark-as-read-forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6948 "D" gnus-summary-mark-as-read-backward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6949 "E" gnus-summary-mark-as-expirable
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6950 "\M-u" gnus-summary-clear-mark-forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6951 "\M-U" gnus-summary-clear-mark-backward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6952 "k" gnus-summary-kill-same-subject-and-select
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6953 "\C-k" gnus-summary-kill-same-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6954 "\M-\C-k" gnus-summary-kill-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6955 "\M-\C-l" gnus-summary-lower-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6956 "e" gnus-summary-edit-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6957 "#" gnus-summary-mark-as-processable
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6958 "\M-#" gnus-summary-unmark-as-processable
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6959 "\M-\C-t" gnus-summary-toggle-threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6960 "\M-\C-s" gnus-summary-show-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6961 "\M-\C-h" gnus-summary-hide-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6962 "\M-\C-f" gnus-summary-next-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6963 "\M-\C-b" gnus-summary-prev-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6964 "\M-\C-u" gnus-summary-up-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6965 "\M-\C-d" gnus-summary-down-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6966 "&" gnus-summary-execute-command
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6967 "c" gnus-summary-catchup-and-exit
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6968 "\C-w" gnus-summary-mark-region-as-read
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6969 "\C-t" gnus-summary-toggle-truncation
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6970 "?" gnus-summary-mark-as-dormant
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6971 "\C-c\M-\C-s" gnus-summary-limit-include-expunged
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6972 "\C-c\C-s\C-n" gnus-summary-sort-by-number
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6973 "\C-c\C-s\C-a" gnus-summary-sort-by-author
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6974 "\C-c\C-s\C-s" gnus-summary-sort-by-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6975 "\C-c\C-s\C-d" gnus-summary-sort-by-date
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6976 "\C-c\C-s\C-i" gnus-summary-sort-by-score
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6977 "=" gnus-summary-expand-window
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6978 "\C-x\C-s" gnus-summary-reselect-current-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6979 "\M-g" gnus-summary-rescan-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6980 "w" gnus-summary-stop-page-breaking
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6981 "\C-c\C-r" gnus-summary-caesar-message
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6982 "\M-t" gnus-summary-toggle-mime
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6983 "f" gnus-summary-followup
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6984 "F" gnus-summary-followup-with-original
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6985 "C" gnus-summary-cancel-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6986 "r" gnus-summary-reply
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6987 "R" gnus-summary-reply-with-original
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6988 "\C-c\C-f" gnus-summary-mail-forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6989 "o" gnus-summary-save-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6990 "\C-o" gnus-summary-save-article-mail
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6991 "|" gnus-summary-pipe-output
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6992 "\M-k" gnus-summary-edit-local-kill
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6993 "\M-K" gnus-summary-edit-global-kill
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6994 "V" gnus-version
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6995 "\C-c\C-d" gnus-summary-describe-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6996 "q" gnus-summary-exit
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6997 "Q" gnus-summary-exit-no-update
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6998 "\C-c\C-i" gnus-info-find-node
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6999 gnus-mouse-2 gnus-mouse-pick-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7000 "m" gnus-summary-mail-other-window
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7001 "a" gnus-summary-post-news
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7002 "x" gnus-summary-limit-to-unread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7003 "s" gnus-summary-isearch-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7004 "t" gnus-article-hide-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7005 "g" gnus-summary-show-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7006 "l" gnus-summary-goto-last-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7007 "\C-c\C-v\C-v" gnus-uu-decode-uu-view
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7008 "\C-d" gnus-summary-enter-digest-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7009 "\C-c\C-b" gnus-bug
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7010 "*" gnus-cache-enter-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7011 "\M-*" gnus-cache-remove-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7012 "\M-&" gnus-summary-universal-argument
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7013 "\C-l" gnus-recenter
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7014 "I" gnus-summary-increase-score
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7015 "L" gnus-summary-lower-score
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7016
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7017 "V" gnus-summary-score-map
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7018 "X" gnus-uu-extract-map
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7019 "S" gnus-summary-send-map)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7020
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7021 ;; Sort of orthogonal keymap
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7022 (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
7023 "t" gnus-summary-tick-article-forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7024 "!" gnus-summary-tick-article-forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7025 "d" gnus-summary-mark-as-read-forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7026 "r" gnus-summary-mark-as-read-forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7027 "c" gnus-summary-clear-mark-forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7028 " " gnus-summary-clear-mark-forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7029 "e" gnus-summary-mark-as-expirable
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7030 "x" gnus-summary-mark-as-expirable
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7031 "?" gnus-summary-mark-as-dormant
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7032 "b" gnus-summary-set-bookmark
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7033 "B" gnus-summary-remove-bookmark
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7034 "#" gnus-summary-mark-as-processable
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7035 "\M-#" gnus-summary-unmark-as-processable
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7036 "S" gnus-summary-limit-include-expunged
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7037 "C" gnus-summary-catchup
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7038 "H" gnus-summary-catchup-to-here
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7039 "\C-c" gnus-summary-catchup-all
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7040 "k" gnus-summary-kill-same-subject-and-select
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7041 "K" gnus-summary-kill-same-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7042 "P" gnus-uu-mark-map)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7043
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7044 (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
7045 "c" gnus-summary-clear-above
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7046 "u" gnus-summary-tick-above
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7047 "m" gnus-summary-mark-above
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7048 "k" gnus-summary-kill-below)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7049
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7050 (gnus-define-keys (gnus-summary-limit-map "/" gnus-summary-mode-map)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7051 "/" gnus-summary-limit-to-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7052 "n" gnus-summary-limit-to-articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7053 "w" gnus-summary-pop-limit
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7054 "s" gnus-summary-limit-to-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7055 "a" gnus-summary-limit-to-author
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7056 "u" gnus-summary-limit-to-unread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7057 "m" gnus-summary-limit-to-marks
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7058 "v" gnus-summary-limit-to-score
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7059 "D" gnus-summary-limit-include-dormant
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7060 "d" gnus-summary-limit-exclude-dormant
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7061 ;; "t" gnus-summary-limit-exclude-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7062 "E" gnus-summary-limit-include-expunged
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7063 "c" gnus-summary-limit-exclude-childless-dormant
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7064 "C" gnus-summary-limit-mark-excluded-as-read)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7065
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7066 (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
7067 "n" gnus-summary-next-unread-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7068 "p" gnus-summary-prev-unread-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7069 "N" gnus-summary-next-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7070 "P" gnus-summary-prev-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7071 "\C-n" gnus-summary-next-same-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7072 "\C-p" gnus-summary-prev-same-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7073 "\M-n" gnus-summary-next-unread-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7074 "\M-p" gnus-summary-prev-unread-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7075 "f" gnus-summary-first-unread-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7076 "b" gnus-summary-best-unread-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7077 "j" gnus-summary-goto-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7078 "g" gnus-summary-goto-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7079 "l" gnus-summary-goto-last-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7080 "p" gnus-summary-pop-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7081
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7082 (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
7083 "k" gnus-summary-kill-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7084 "l" gnus-summary-lower-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7085 "i" gnus-summary-raise-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7086 "T" gnus-summary-toggle-threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7087 "t" gnus-summary-rethread-current
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7088 "^" gnus-summary-reparent-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7089 "s" gnus-summary-show-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7090 "S" gnus-summary-show-all-threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7091 "h" gnus-summary-hide-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7092 "H" gnus-summary-hide-all-threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7093 "n" gnus-summary-next-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7094 "p" gnus-summary-prev-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7095 "u" gnus-summary-up-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7096 "o" gnus-summary-top-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7097 "d" gnus-summary-down-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7098 "#" gnus-uu-mark-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7099 "\M-#" gnus-uu-unmark-thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7100
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7101 (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
7102 "c" gnus-summary-catchup-and-exit
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7103 "C" gnus-summary-catchup-all-and-exit
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7104 "E" gnus-summary-exit-no-update
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7105 "Q" gnus-summary-exit
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7106 "Z" gnus-summary-exit
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7107 "n" gnus-summary-catchup-and-goto-next-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7108 "R" gnus-summary-reselect-current-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7109 "G" gnus-summary-rescan-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7110 "N" gnus-summary-next-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7111 "P" gnus-summary-prev-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7112
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7113 (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
7114 " " gnus-summary-next-page
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7115 "n" gnus-summary-next-page
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7116 "\177" gnus-summary-prev-page
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7117 [delete] gnus-summary-prev-page
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7118 "p" gnus-summary-prev-page
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7119 "\r" gnus-summary-scroll-up
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7120 "<" gnus-summary-beginning-of-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7121 ">" gnus-summary-end-of-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7122 "b" gnus-summary-beginning-of-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7123 "e" gnus-summary-end-of-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7124 "^" gnus-summary-refer-parent-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7125 "r" gnus-summary-refer-parent-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7126 "R" gnus-summary-refer-references
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7127 "g" gnus-summary-show-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7128 "s" gnus-summary-isearch-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7129
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7130 (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
7131 "b" gnus-article-add-buttons
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7132 "B" gnus-article-add-buttons-to-head
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7133 "o" gnus-article-treat-overstrike
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7134 ;; "w" gnus-article-word-wrap
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7135 "w" gnus-article-fill-cited-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7136 "c" gnus-article-remove-cr
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7137 "L" gnus-article-remove-trailing-blank-lines
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7138 "q" gnus-article-de-quoted-unreadable
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7139 "f" gnus-article-display-x-face
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7140 "l" gnus-summary-stop-page-breaking
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7141 "r" gnus-summary-caesar-message
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7142 "t" gnus-article-hide-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7143 "v" gnus-summary-verbose-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7144 "m" gnus-summary-toggle-mime)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7145
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7146 (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
7147 "a" gnus-article-hide
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7148 "h" gnus-article-hide-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7149 "b" gnus-article-hide-boring-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7150 "s" gnus-article-hide-signature
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7151 "c" gnus-article-hide-citation
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7152 "p" gnus-article-hide-pgp
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7153 "\C-c" gnus-article-hide-citation-maybe)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7154
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7155 (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
7156 "a" gnus-article-highlight
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7157 "h" gnus-article-highlight-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7158 "c" gnus-article-highlight-citation
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7159 "s" gnus-article-highlight-signature)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7160
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7161 (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
7162 "z" gnus-article-date-ut
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7163 "u" gnus-article-date-ut
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7164 "l" gnus-article-date-local
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7165 "e" gnus-article-date-lapsed
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7166 "o" gnus-article-date-original)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7167
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7168 (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
7169 "v" gnus-version
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7170 "f" gnus-summary-fetch-faq
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7171 "d" gnus-summary-describe-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7172 "h" gnus-summary-describe-briefly
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7173 "i" gnus-info-find-node)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7174
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7175 (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
7176 "e" gnus-summary-expire-articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7177 "\M-\C-e" gnus-summary-expire-articles-now
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7178 "\177" gnus-summary-delete-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7179 [delete] gnus-summary-delete-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7180 "m" gnus-summary-move-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7181 "r" gnus-summary-respool-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7182 "w" gnus-summary-edit-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7183 "c" gnus-summary-copy-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7184 "B" gnus-summary-crosspost-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7185 "q" gnus-summary-respool-query
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7186 "i" gnus-summary-import-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7187
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7188 (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
7189 "o" gnus-summary-save-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7190 "m" gnus-summary-save-article-mail
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7191 "r" gnus-summary-save-article-rmail
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7192 "f" gnus-summary-save-article-file
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7193 "b" gnus-summary-save-article-body-file
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7194 "h" gnus-summary-save-article-folder
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7195 "v" gnus-summary-save-article-vm
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7196 "p" gnus-summary-pipe-output
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7197 "s" gnus-soup-add-article)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7198 )
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7199
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 (defun gnus-summary-mode (&optional group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7203 "Major mode for reading articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7204
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7205 All normal editing commands are switched off.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7206 \\<gnus-summary-mode-map>
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7207 Each line in this buffer represents one article. To read an
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7208 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
7209 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
7210 respectively.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7211
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7212 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
7213 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
7214 of an article, type `\\[gnus-summary-reply]'.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7215
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7216 There are approx. one gazillion commands you can execute in this
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7217 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
7218
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7219 The following commands are available:
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 \\{gnus-summary-mode-map}"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7222 (interactive)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7223 (when (and menu-bar-mode
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7224 (gnus-visual-p 'summary-menu 'menu))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7225 (gnus-summary-make-menu-bar))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7226 (kill-all-local-variables)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7227 (gnus-summary-make-local-variables)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7228 (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
7229 (gnus-simplify-mode-line)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7230 (setq major-mode 'gnus-summary-mode)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7231 (setq mode-name "Summary")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7232 (make-local-variable 'minor-mode-alist)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7233 (use-local-map gnus-summary-mode-map)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7234 (buffer-disable-undo (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7235 (setq buffer-read-only t) ;Disable modification
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7236 (setq truncate-lines t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7237 (setq selective-display t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7238 (setq selective-display-ellipses t) ;Display `...'
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7239 (setq buffer-display-table gnus-summary-display-table)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7240 (setq gnus-newsgroup-name group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7241 (make-local-variable 'gnus-summary-line-format)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7242 (make-local-variable 'gnus-summary-line-format-spec)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7243 (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
7244 (gnus-make-local-hook 'post-command-hook)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
7245 (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
7246 (run-hooks 'gnus-summary-mode-hook))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7247
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7248 (defun gnus-summary-make-local-variables ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7249 "Make all the local summary buffer variables."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7250 (let ((locals gnus-summary-local-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7251 global local)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7252 (while (setq local (pop locals))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7253 (if (consp local)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7254 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7255 (if (eq (cdr local) 'global)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7256 ;; Copy the global value of the variable.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7257 (setq global (symbol-value (car local)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7258 ;; Use the value from the list.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7259 (setq global (eval (cdr local))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7260 (make-local-variable (car local))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7261 (set (car local) global))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7262 ;; Simple nil-valued local variable.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7263 (make-local-variable local)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7264 (set local nil)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7265
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7266 (defun gnus-summary-make-display-table ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7267 ;; 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
7268 ;; up nicely formatted displays - we make all possible glyphs
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7269 ;; display only a single character.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7270
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7271 ;; We start from the standard display table, if any.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7272 (setq gnus-summary-display-table
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7273 (or (copy-sequence standard-display-table)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7274 (make-display-table)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7275 ;; Nix out all the control chars...
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7276 (let ((i 32))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7277 (while (>= (setq i (1- i)) 0)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7278 (aset gnus-summary-display-table i [??])))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7279 ;; ... 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
7280 ;; selective display).
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7281 (aset gnus-summary-display-table ?\n nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7282 (aset gnus-summary-display-table ?\r nil)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7283 ;; 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
7284 (let ((i 256))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7285 (while (>= (setq i (1- i)) 127)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7286 ;; Only modify if the entry is nil.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7287 (or (aref gnus-summary-display-table i)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7288 (aset gnus-summary-display-table i [??])))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7289
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7290 (defun gnus-summary-clear-local-variables ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7291 (let ((locals gnus-summary-local-variables))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7292 (while locals
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7293 (if (consp (car locals))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7294 (and (vectorp (caar locals))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7295 (set (caar locals) nil))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7296 (and (vectorp (car locals))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7297 (set (car locals) nil)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7298 (setq locals (cdr locals)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7299
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7300 ;; Summary data functions.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7301
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7302 (defmacro gnus-data-number (data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7303 `(car ,data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7304
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7305 (defmacro gnus-data-set-number (data number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7306 `(setcar ,data ,number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7307
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7308 (defmacro gnus-data-mark (data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7309 `(nth 1 ,data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7310
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7311 (defmacro gnus-data-set-mark (data mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7312 `(setcar (nthcdr 1 ,data) ,mark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7313
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7314 (defmacro gnus-data-pos (data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7315 `(nth 2 ,data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7316
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7317 (defmacro gnus-data-set-pos (data pos)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7318 `(setcar (nthcdr 2 ,data) ,pos))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7319
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7320 (defmacro gnus-data-header (data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7321 `(nth 3 ,data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7322
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7323 (defmacro gnus-data-level (data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7324 `(nth 4 ,data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7325
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7326 (defmacro gnus-data-unread-p (data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7327 `(= (nth 1 ,data) gnus-unread-mark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7328
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7329 (defmacro gnus-data-pseudo-p (data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7330 `(consp (nth 3 ,data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7331
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7332 (defmacro gnus-data-find (number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7333 `(assq ,number gnus-newsgroup-data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7334
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7335 (defmacro gnus-data-find-list (number &optional data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7336 `(let ((bdata ,(or data 'gnus-newsgroup-data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7337 (memq (assq ,number bdata)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7338 bdata)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7339
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7340 (defmacro gnus-data-make (number mark pos header level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7341 `(list ,number ,mark ,pos ,header ,level))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7342
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7343 (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
7344 (let ((data (gnus-data-find-list after-article)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7345 (or data (error "No such article: %d" after-article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7346 (setcdr data (cons (gnus-data-make number mark pos header level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7347 (cdr data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7348 (setq gnus-newsgroup-data-reverse nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7349 (gnus-data-update-list (cddr data) offset)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7350
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7351 (defun gnus-data-enter-list (after-article list &optional offset)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7352 (when list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7353 (let ((data (and after-article (gnus-data-find-list after-article)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7354 (ilist list))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7355 (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
7356 ;; 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
7357 ;; list.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7358 (while (cdr list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7359 (setq list (cdr list)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7360 (if (not data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7361 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7362 (setcdr list gnus-newsgroup-data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7363 (setq gnus-newsgroup-data ilist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7364 (and offset (gnus-data-update-list (cdr list) offset)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7365 (setcdr list (cdr data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7366 (setcdr data ilist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7367 (and offset (gnus-data-update-list (cdr data) offset)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7368 (setq gnus-newsgroup-data-reverse nil))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7369
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7370 (defun gnus-data-remove (article &optional offset)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7371 (let ((data gnus-newsgroup-data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7372 (if (= (gnus-data-number (car data)) article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7373 (setq gnus-newsgroup-data (cdr gnus-newsgroup-data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7374 gnus-newsgroup-data-reverse nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7375 (while (cdr data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7376 (and (= (gnus-data-number (cadr data)) article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7377 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7378 (setcdr data (cddr data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7379 (and offset (gnus-data-update-list (cdr data) offset))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7380 (setq data nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7381 gnus-newsgroup-data-reverse nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7382 (setq data (cdr data))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7383
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7384 (defmacro gnus-data-list (backward)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7385 `(if ,backward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7386 (or gnus-newsgroup-data-reverse
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7387 (setq gnus-newsgroup-data-reverse
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7388 (reverse gnus-newsgroup-data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7389 gnus-newsgroup-data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7390
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7391 (defun gnus-data-update-list (data offset)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7392 "Add OFFSET to the POS of all data entries in DATA."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7393 (while data
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7394 (setcar (nthcdr 2 (car data)) (+ offset (nth 2 (car data))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7395 (setq data (cdr data))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7396
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7397 (defun gnus-data-compute-positions ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7398 "Compute the positions of all articles."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7399 (let ((data gnus-newsgroup-data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7400 pos)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7401 (while data
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7402 (when (setq pos (text-property-any
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7403 (point-min) (point-max)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7404 'gnus-number (gnus-data-number (car data))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7405 (gnus-data-set-pos (car data) (+ pos 3)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7406 (setq data (cdr data)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7407
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7408 (defun gnus-summary-article-pseudo-p (article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7409 "Say whether this article is a pseudo article or not."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7410 (not (vectorp (gnus-data-header (gnus-data-find article)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7411
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7412 (defun gnus-article-parent-p (number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7413 "Say whether this article is a parent or not."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7414 (let ((data (gnus-data-find-list number)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7415 (and (cdr data) ; There has to be an article after...
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7416 (< (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
7417 (gnus-data-level (nth 1 data))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7418
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7419 (defun gnus-article-children (number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7420 "Return a list of all children to NUMBER."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7421 (let* ((data (gnus-data-find-list number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7422 (level (gnus-data-level (car data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7423 children)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7424 (setq data (cdr data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7425 (while (and data
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7426 (= (gnus-data-level (car data)) (1+ level)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7427 (push (gnus-data-number (car data)) children)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7428 (setq data (cdr data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7429 children))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7430
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7431 (defmacro gnus-summary-skip-intangible ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7432 "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
7433 '(let ((to (get-text-property (point) 'gnus-intangible)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7434 (and to (gnus-summary-goto-subject to))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7435
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7436 (defmacro gnus-summary-article-intangible-p ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7437 "Say whether this article is intangible or not."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7438 '(get-text-property (point) 'gnus-intangible))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7439
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7440 ;; Some summary mode macros.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7441
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7442 (defmacro gnus-summary-article-number ()
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7443 "The article number of the article on the current line.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7444 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
7445 article number."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7446 '(progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7447 (gnus-summary-skip-intangible)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7448 (or (get-text-property (point) 'gnus-number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7449 (gnus-summary-last-subject))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7450
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7451 (defmacro gnus-summary-article-header (&optional number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7452 `(gnus-data-header (gnus-data-find
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7453 ,(or number '(gnus-summary-article-number)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7454
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7455 (defmacro gnus-summary-thread-level (&optional number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7456 `(if (and (eq gnus-summary-make-false-root 'dummy)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7457 (get-text-property (point) 'gnus-intangible))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7458 0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7459 (gnus-data-level (gnus-data-find
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7460 ,(or number '(gnus-summary-article-number))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7461
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7462 (defmacro gnus-summary-article-mark (&optional number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7463 `(gnus-data-mark (gnus-data-find
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7464 ,(or number '(gnus-summary-article-number)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7465
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7466 (defmacro gnus-summary-article-pos (&optional number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7467 `(gnus-data-pos (gnus-data-find
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7468 ,(or number '(gnus-summary-article-number)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7469
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7470 (defalias 'gnus-summary-subject-string 'gnus-summary-article-subject)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7471 (defmacro gnus-summary-article-subject (&optional number)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7472 "Return current subject string or nil if nothing."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7473 `(let ((headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7474 ,(if number
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7475 `(gnus-data-header (assq ,number gnus-newsgroup-data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7476 '(gnus-data-header (assq (gnus-summary-article-number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7477 gnus-newsgroup-data)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7478 (and headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7479 (vectorp headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7480 (mail-header-subject headers))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7481
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7482 (defmacro gnus-summary-article-score (&optional number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7483 "Return current article score."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7484 `(or (cdr (assq ,(or number '(gnus-summary-article-number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7485 gnus-newsgroup-scored))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7486 gnus-summary-default-score 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7487
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7488 (defun gnus-summary-article-children (&optional number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7489 (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
7490 (level (gnus-data-level (car data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7491 l children)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7492 (while (and (setq data (cdr data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7493 (> (setq l (gnus-data-level (car data))) level))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7494 (and (= (1+ level) l)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7495 (setq children (cons (gnus-data-number (car data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7496 children))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7497 (nreverse children)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7498
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7499 (defun gnus-summary-article-parent (&optional number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7500 (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
7501 (gnus-data-list t)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7502 (level (gnus-data-level (car data))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7503 (if (zerop level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7504 () ; This is a root.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7505 ;; 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
7506 ;; this one. That function has to be the parent.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7507 (while (and (setq data (cdr data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7508 (not (< (gnus-data-level (car data)) level))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7509 (and data (gnus-data-number (car data))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7510
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7511 (defun gnus-unread-mark-p (mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7512 "Say whether MARK is the unread mark."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7513 (= mark gnus-unread-mark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7514
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7515 (defun gnus-read-mark-p (mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7516 "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
7517 This is all marks except unread, ticked, dormant, and expirable."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7518 (not (or (= mark gnus-unread-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7519 (= mark gnus-ticked-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7520 (= mark gnus-dormant-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7521 (= mark gnus-expirable-mark))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7522
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7523 ;; Saving hidden threads.
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 (put 'gnus-save-hidden-threads 'lisp-indent-function 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7526 (put 'gnus-save-hidden-threads 'lisp-indent-hook 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7527 (put 'gnus-save-hidden-threads 'edebug-form-spec '(body))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7528
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7529 (defmacro gnus-save-hidden-threads (&rest forms)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7530 "Save hidden threads, eval FORMS, and restore the hidden threads."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7531 (let ((config (make-symbol "config")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7532 `(let ((,config (gnus-hidden-threads-configuration)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7533 (unwind-protect
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7534 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7535 ,@forms)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7536 (gnus-restore-hidden-threads-configuration ,config)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7537
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7538 (defun gnus-hidden-threads-configuration ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7539 "Return the current hidden threads configuration."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7540 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7541 (let (config)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7542 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7543 (while (search-forward "\r" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7544 (push (1- (point)) config))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7545 config)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7546
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7547 (defun gnus-restore-hidden-threads-configuration (config)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7548 "Restore hidden threads configuration from CONFIG."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7549 (let (point buffer-read-only)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7550 (while (setq point (pop config))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7551 (when (and (< point (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7552 (goto-char point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7553 (= (following-char) ?\n))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7554 (subst-char-in-region point (1+ point) ?\n ?\r)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7555
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7556 ;; Various summary mode internalish functions.
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 (defun gnus-mouse-pick-article (e)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7559 (interactive "e")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7560 (mouse-set-point e)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7561 (gnus-summary-next-page nil t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7562
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7563 (defun gnus-summary-setup-buffer (group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7564 "Initialize summary buffer."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7565 (let ((buffer (concat "*Summary " group "*")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7566 (if (get-buffer buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7567 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7568 (set-buffer buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7569 (setq gnus-summary-buffer (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7570 (not gnus-newsgroup-prepared))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7571 ;; Fix by Sudish Joseph <joseph@cis.ohio-state.edu>
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7572 (setq gnus-summary-buffer (set-buffer (get-buffer-create buffer)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7573 (gnus-add-current-to-buffer-list)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7574 (gnus-summary-mode group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7575 (when gnus-carpal
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7576 (gnus-carpal-setup-buffer 'summary))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7577 (unless gnus-single-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7578 (make-local-variable 'gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7579 (make-local-variable 'gnus-article-current)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7580 (make-local-variable 'gnus-original-article-buffer))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7581 (setq gnus-newsgroup-name group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7582 t)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7583
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7584 (defun gnus-set-global-variables ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7585 ;; Set the global equivalents of the summary buffer-local variables
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7586 ;; 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
7587 ;; that was in action when the last article was fetched.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7588 (when (eq major-mode 'gnus-summary-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7589 (setq gnus-summary-buffer (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7590 (let ((name gnus-newsgroup-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7591 (marked gnus-newsgroup-marked)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7592 (unread gnus-newsgroup-unreads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7593 (headers gnus-current-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7594 (data gnus-newsgroup-data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7595 (summary gnus-summary-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7596 (article-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7597 (original gnus-original-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7598 (gac gnus-article-current)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7599 (score-file gnus-current-score-file))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7600 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7601 (set-buffer gnus-group-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7602 (setq gnus-newsgroup-name name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7603 (setq gnus-newsgroup-marked marked)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7604 (setq gnus-newsgroup-unreads unread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7605 (setq gnus-current-headers headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7606 (setq gnus-newsgroup-data data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7607 (setq gnus-article-current gac)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7608 (setq gnus-summary-buffer summary)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7609 (setq gnus-article-buffer article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7610 (setq gnus-original-article-buffer original)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7611 (setq gnus-current-score-file score-file)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7612
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7613 (defun gnus-summary-last-article-p (&optional article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7614 "Return whether ARTICLE is the last article in the buffer."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7615 (if (not (setq article (or article (gnus-summary-article-number))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7616 t ; All non-existant numbers are the last article. :-)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7617 (not (cdr (gnus-data-find-list article)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7618
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7619 (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
7620 "Insert a dummy root in the summary buffer."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7621 (beginning-of-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7622 (gnus-add-text-properties
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7623 (point) (progn (eval gnus-summary-dummy-line-format-spec) (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7624 (list 'gnus-number gnus-tmp-number 'gnus-intangible gnus-tmp-number)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7625
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7626 (defun gnus-make-thread-indent-array ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7627 (let ((n 200))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7628 (unless (and gnus-thread-indent-array
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7629 (= gnus-thread-indent-level gnus-thread-indent-array-level))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7630 (setq gnus-thread-indent-array (make-vector 201 "")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7631 gnus-thread-indent-array-level gnus-thread-indent-level)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7632 (while (>= n 0)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7633 (aset gnus-thread-indent-array n
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7634 (make-string (* n gnus-thread-indent-level) ? ))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7635 (setq n (1- n))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7636
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7637 (defun gnus-summary-insert-line
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7638 (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
7639 gnus-tmp-replied gnus-tmp-expirable gnus-tmp-subject-or-nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7640 &optional gnus-tmp-dummy gnus-tmp-score gnus-tmp-process)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7641 (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
7642 (gnus-tmp-lines (mail-header-lines gnus-tmp-header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7643 (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
7644 (gnus-tmp-score-char
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7645 (if (or (null gnus-summary-default-score)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7646 (<= (abs (- gnus-tmp-score gnus-summary-default-score))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7647 gnus-summary-zcore-fuzz)) ?
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7648 (if (< gnus-tmp-score gnus-summary-default-score)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7649 gnus-score-below-mark gnus-score-over-mark)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7650 (gnus-tmp-replied (cond (gnus-tmp-process gnus-process-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7651 ((memq gnus-tmp-current gnus-newsgroup-cached)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7652 gnus-cached-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7653 (gnus-tmp-replied gnus-replied-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7654 ((memq gnus-tmp-current gnus-newsgroup-saved)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7655 gnus-saved-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7656 (t gnus-unread-mark)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7657 (gnus-tmp-from (mail-header-from gnus-tmp-header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7658 (gnus-tmp-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7659 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7660 ((string-match "(.+)" gnus-tmp-from)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7661 (substring gnus-tmp-from
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7662 (1+ (match-beginning 0)) (1- (match-end 0))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7663 ((string-match "<[^>]+> *$" gnus-tmp-from)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7664 (let ((beg (match-beginning 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7665 (or (and (string-match "^\"[^\"]*\"" gnus-tmp-from)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7666 (substring gnus-tmp-from (1+ (match-beginning 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7667 (1- (match-end 0))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7668 (substring gnus-tmp-from 0 beg))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7669 (t gnus-tmp-from)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7670 (gnus-tmp-subject (mail-header-subject gnus-tmp-header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7671 (gnus-tmp-number (mail-header-number gnus-tmp-header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7672 (gnus-tmp-opening-bracket (if gnus-tmp-dummy ?\< ?\[))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7673 (gnus-tmp-closing-bracket (if gnus-tmp-dummy ?\> ?\]))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7674 (buffer-read-only nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7675 (when (string= gnus-tmp-name "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7676 (setq gnus-tmp-name gnus-tmp-from))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7677 (or (numberp gnus-tmp-lines) (setq gnus-tmp-lines 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7678 (gnus-put-text-property
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7679 (point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7680 (progn (eval gnus-summary-line-format-spec) (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7681 'gnus-number gnus-tmp-number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7682 (when (gnus-visual-p 'summary-highlight 'highlight)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7683 (forward-line -1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7684 (run-hooks 'gnus-summary-update-hook)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7685 (forward-line 1))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7686
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7687 (defun gnus-summary-update-line (&optional dont-update)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7688 ;; Update summary line after change.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7689 (when (and gnus-summary-default-score
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7690 (not gnus-summary-inhibit-highlight))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7691 (let* ((gnus-summary-inhibit-highlight t) ; Prevent recursion.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7692 (article (gnus-summary-article-number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7693 (score (gnus-summary-article-score article)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7694 (unless dont-update
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7695 (if (and gnus-summary-mark-below
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7696 (< (gnus-summary-article-score)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7697 gnus-summary-mark-below))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7698 ;; 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
7699 (when (memq article gnus-newsgroup-unreads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7700 (gnus-summary-mark-article-as-read gnus-low-score-mark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7701 (when (eq (gnus-summary-article-mark) gnus-low-score-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7702 ;; This article was previously marked as read on account
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7703 ;; 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
7704 ;; unread.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7705 (gnus-summary-mark-article-as-unread gnus-unread-mark)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7706 (gnus-summary-update-mark
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7707 (if (or (null gnus-summary-default-score)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7708 (<= (abs (- score gnus-summary-default-score))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7709 gnus-summary-zcore-fuzz)) ?
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7710 (if (< score gnus-summary-default-score)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7711 gnus-score-below-mark gnus-score-over-mark)) 'score))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7712 ;; Do visual highlighting.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7713 (when (gnus-visual-p 'summary-highlight 'highlight)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7714 (run-hooks 'gnus-summary-update-hook)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7715
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7716 (defvar gnus-tmp-new-adopts nil)
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 (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
7719 ;; Sum up all elements (and sub-elements) in a list.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7720 (let* ((number
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7721 ;; 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
7722 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7723 ((and (consp thread) (cdr thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7724 (apply
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7725 '+ 1 (mapcar
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7726 'gnus-summary-number-of-articles-in-thread (cdr thread))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7727 ((null thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7728 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7729 ((memq (mail-header-number (car thread)) gnus-newsgroup-limit)
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 (t 0))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7732 (when (and level (zerop level) gnus-tmp-new-adopts)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7733 (incf number
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7734 (apply '+ (mapcar
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7735 'gnus-summary-number-of-articles-in-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7736 gnus-tmp-new-adopts))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7737 (if char
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7738 (if (> number 1) gnus-not-empty-thread-mark
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7739 gnus-empty-thread-mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7740 number)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7741
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7742 (defun gnus-summary-set-local-parameters (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7743 "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
7744 (let ((params (gnus-info-params (gnus-get-info group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7745 elem)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7746 (while params
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7747 (setq elem (car params)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7748 params (cdr params))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7749 (and (consp elem) ; Has to be a cons.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7750 (consp (cdr elem)) ; The cdr has to be a list.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7751 (symbolp (car elem)) ; Has to be a symbol in there.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7752 (not (memq (car elem)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7753 '(quit-config to-address to-list to-group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7754 (progn ; So we set it.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7755 (make-local-variable (car elem))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7756 (set (car elem) (eval (nth 1 elem))))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7757
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7758 (defun gnus-summary-read-group (group &optional show-all no-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7759 kill-buffer no-display)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7760 "Start reading news in newsgroup GROUP.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7761 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
7762 If NO-ARTICLE is non-nil, no article is selected initially.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7763 If NO-DISPLAY, don't generate a summary buffer."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7764 (gnus-message 5 "Retrieving newsgroup: %s..." group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7765 (let* ((new-group (gnus-summary-setup-buffer group))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7766 (quit-config (gnus-group-quit-config group))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7767 (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
7768 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7769 ;; This summary buffer exists already, so we just select it.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7770 ((not new-group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7771 (gnus-set-global-variables)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7772 (when kill-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7773 (gnus-kill-or-deaden-summary kill-buffer))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7774 (gnus-configure-windows 'summary 'force)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7775 (gnus-set-mode-line 'summary)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7776 (gnus-summary-position-point)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7777 (message "")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7778 t)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7779 ;; We couldn't select this group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7780 ((null did-select)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7781 (when (and (eq major-mode 'gnus-summary-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7782 (not (equal (current-buffer) kill-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7783 (kill-buffer (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7784 (if (not quit-config)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7785 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7786 (set-buffer gnus-group-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7787 (gnus-group-jump-to-group group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7788 (gnus-group-next-unread-group 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7789 (if (not (buffer-name (car quit-config)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7790 (gnus-configure-windows 'group 'force)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7791 (set-buffer (car quit-config))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7792 (and (eq major-mode 'gnus-summary-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7793 (gnus-set-global-variables))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7794 (gnus-configure-windows (cdr quit-config)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7795 (gnus-message 3 "Can't select group")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7796 nil)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7797 ;; 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
7798 ;; so we exit this group.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7799 ((eq did-select 'quit)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7800 (and (eq major-mode 'gnus-summary-mode)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7801 (not (equal (current-buffer) kill-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7802 (kill-buffer (current-buffer)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7803 (when kill-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7804 (gnus-kill-or-deaden-summary kill-buffer))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7805 (if (not quit-config)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7806 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7807 (set-buffer gnus-group-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7808 (gnus-group-jump-to-group group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7809 (gnus-group-next-unread-group 1)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7810 (gnus-configure-windows 'group 'force))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7811 (if (not (buffer-name (car quit-config)))
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 (set-buffer (car quit-config))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7814 (and (eq major-mode 'gnus-summary-mode)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7815 (gnus-set-global-variables))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7816 (gnus-configure-windows (cdr quit-config))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7817 ;; Finally signal the quit.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7818 (signal 'quit nil))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7819 ;; The group was successfully selected.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7820 (t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7821 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7822 ;; 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
7823 (setq gnus-newsgroup-active
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7824 (gnus-copy-sequence
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7825 (gnus-active gnus-newsgroup-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7826 ;; 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
7827 (run-hooks 'gnus-select-group-hook)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7828 ;; Set any local variables in the group parameters.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7829 (gnus-summary-set-local-parameters gnus-newsgroup-name)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7830 (gnus-update-format-specifications)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7831 ;; Do score processing.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7832 (when gnus-use-scoring
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7833 (gnus-possibly-score-headers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7834 ;; Check whether to fill in the gaps in the threads.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7835 (when gnus-build-sparse-threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7836 (gnus-build-sparse-threads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7837 ;; Find the initial limit.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7838 (if gnus-show-threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7839 (if show-all
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7840 (let ((gnus-newsgroup-dormant nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7841 (gnus-summary-initial-limit show-all))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7842 (gnus-summary-initial-limit show-all))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7843 (setq gnus-newsgroup-limit
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7844 (mapcar
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7845 (lambda (header) (mail-header-number header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7846 gnus-newsgroup-headers)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7847 ;; Generate the summary buffer.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7848 (unless no-display
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7849 (gnus-summary-prepare))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7850 (when gnus-use-trees
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7851 (gnus-tree-open group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7852 (setq gnus-summary-highlight-line-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7853 'gnus-tree-highlight-article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7854 ;; 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
7855 ;; articles or some excluded dormants, we include these in the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7856 ;; buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7857 (when (and (zerop (buffer-size))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7858 (not no-display))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7859 (cond (gnus-newsgroup-dormant
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7860 (gnus-summary-limit-include-dormant))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7861 ((and gnus-newsgroup-scored show-all)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7862 (gnus-summary-limit-include-expunged))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7863 ;; Function `gnus-apply-kill-file' must be called in this hook.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7864 (run-hooks 'gnus-apply-kill-hook)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7865 (if (and (zerop (buffer-size))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7866 (not no-display))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7867 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7868 ;; This newsgroup is empty.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7869 (gnus-summary-catchup-and-exit nil t) ;Without confirmations.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7870 (gnus-message 6 "No unread news")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7871 (when kill-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7872 (gnus-kill-or-deaden-summary kill-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7873 ;; Return nil from this function.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7874 nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7875 ;; Hide conversation thread subtrees. We cannot do this in
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7876 ;; gnus-summary-prepare-hook since kill processing may not
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7877 ;; work with hidden articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7878 (and gnus-show-threads
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7879 gnus-thread-hide-subtree
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7880 (gnus-summary-hide-all-threads))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7881 ;; Show first unread article if requested.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7882 (if (and (not no-article)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7883 (not no-display)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7884 gnus-newsgroup-unreads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7885 gnus-auto-select-first)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7886 (unless (if (eq gnus-auto-select-first 'best)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7887 (gnus-summary-best-unread-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7888 (gnus-summary-first-unread-article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7889 (gnus-configure-windows 'summary))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7890 ;; Don't select any articles, just move point to the first
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7891 ;; article in the group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7892 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7893 (gnus-summary-position-point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7894 (gnus-set-mode-line 'summary)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7895 (gnus-configure-windows 'summary 'force))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7896 ;; 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
7897 (when gnus-newsgroup-async
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7898 (gnus-request-asynchronous gnus-newsgroup-name gnus-newsgroup-data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7899 (when kill-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7900 (gnus-kill-or-deaden-summary kill-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7901 (when (get-buffer-window gnus-group-buffer t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7902 ;; Gotta use windows, because recenter does wierd stuff if
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7903 ;; the current buffer ain't the displayed window.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7904 (let ((owin (selected-window)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7905 (select-window (get-buffer-window gnus-group-buffer t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7906 (when (gnus-group-goto-group group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7907 (recenter))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7908 (select-window owin))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7909 ;; Mark this buffer as "prepared".
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7910 (setq gnus-newsgroup-prepared t)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7911 t))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7912
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7913 (defun gnus-summary-prepare ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7914 "Generate the summary buffer."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7915 (let ((buffer-read-only nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7916 (erase-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7917 (setq gnus-newsgroup-data nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7918 gnus-newsgroup-data-reverse nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7919 (run-hooks 'gnus-summary-generate-hook)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7920 ;; Generate the buffer, either with threads or without.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7921 (when gnus-newsgroup-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7922 (gnus-summary-prepare-threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7923 (if gnus-show-threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7924 (gnus-sort-gathered-threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7925 (funcall gnus-summary-thread-gathering-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7926 (gnus-sort-threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7927 (gnus-cut-threads (gnus-make-threads)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7928 ;; Unthreaded display.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7929 (gnus-sort-articles gnus-newsgroup-headers))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7930 (setq gnus-newsgroup-data (nreverse gnus-newsgroup-data))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7931 ;; Call hooks for modifying summary buffer.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7932 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7933 (run-hooks 'gnus-summary-prepare-hook)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7934
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7935 (defun gnus-gather-threads-by-subject (threads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7936 "Gather threads by looking at Subject headers."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7937 (if (not gnus-summary-make-false-root)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7938 threads
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7939 (let ((hashtb (gnus-make-hashtable 1023))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7940 (prev threads)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7941 (result threads)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7942 subject hthread whole-subject)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7943 (while threads
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7944 (setq whole-subject (mail-header-subject (caar threads)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7945 (setq subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7946 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7947 ;; Truncate the subject.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7948 ((numberp gnus-summary-gather-subject-limit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7949 (setq subject (gnus-simplify-subject-re whole-subject))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7950 (if (> (length subject) gnus-summary-gather-subject-limit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7951 (substring subject 0 gnus-summary-gather-subject-limit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7952 subject))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7953 ;; Fuzzily simplify it.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7954 ((eq 'fuzzy gnus-summary-gather-subject-limit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7955 (gnus-simplify-subject-fuzzy whole-subject))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7956 ;; Just remove the leading "Re:".
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7957 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7958 (gnus-simplify-subject-re whole-subject))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7959
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7960 (if (and gnus-summary-gather-exclude-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7961 (string-match gnus-summary-gather-exclude-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7962 subject))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7963 () ; We don't want to do anything with this article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7964 ;; We simplify the subject before looking it up in the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7965 ;; hash table.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7966
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7967 (if (setq hthread (gnus-gethash subject hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7968 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7969 ;; We enter a dummy root into the thread, if we
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7970 ;; haven't done that already.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7971 (unless (stringp (caar hthread))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7972 (setcar hthread (list whole-subject (car hthread))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7973 ;; We add this new gathered thread to this gathered
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7974 ;; thread.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7975 (setcdr (car hthread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7976 (nconc (cdar hthread) (list (car threads))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7977 ;; Remove it from the list of threads.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7978 (setcdr prev (cdr threads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7979 (setq threads prev))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7980 ;; Enter this thread into the hash table.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7981 (gnus-sethash subject threads hashtb)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7982 (setq prev threads)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7983 (setq threads (cdr threads)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7984 result)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7985
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7986 (defun gnus-gather-threads-by-references (threads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7987 "Gather threads by looking at References headers."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7988 (let ((idhashtb (gnus-make-hashtable 1023))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7989 (thhashtb (gnus-make-hashtable 1023))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7990 (prev threads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7991 (result threads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7992 ids references id gthread gid entered)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7993 (while threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7994 (when (setq references (mail-header-references (caar threads)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7995 (setq id (mail-header-id (caar threads)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7996 (setq ids (gnus-split-references references))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7997 (setq entered nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7998 (while ids
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7999 (if (not (setq gid (gnus-gethash (car ids) idhashtb)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8000 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8001 (gnus-sethash (car ids) id idhashtb)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8002 (gnus-sethash id threads thhashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8003 (setq gthread (gnus-gethash gid thhashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8004 (unless entered
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8005 ;; We enter a dummy root into the thread, if we
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8006 ;; haven't done that already.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8007 (unless (stringp (caar gthread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8008 (setcar gthread (list (mail-header-subject (caar gthread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8009 (car gthread))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8010 ;; We add this new gathered thread to this gathered
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8011 ;; thread.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8012 (setcdr (car gthread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8013 (nconc (cdar gthread) (list (car threads)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8014 ;; Add it into the thread hash table.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8015 (gnus-sethash id gthread thhashtb)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8016 (setq entered t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8017 ;; Remove it from the list of threads.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8018 (setcdr prev (cdr threads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8019 (setq threads prev))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8020 (setq ids (cdr ids))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8021 (setq prev threads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8022 (setq threads (cdr threads)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8023 result))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8024
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8025 (defun gnus-sort-gathered-threads (threads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8026 "Sort subtreads inside each gathered thread by article number."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8027 (let ((result threads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8028 (while threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8029 (when (stringp (caar threads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8030 (setcdr (car threads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8031 (sort (cdar threads) 'gnus-thread-sort-by-number)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8032 (setq threads (cdr threads)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8033 result))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8034
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8035 (defun gnus-make-threads ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8036 "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
8037 (let (threads)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8038 (mapatoms
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8039 (lambda (refs)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8040 (unless (car (symbol-value refs))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8041 ;; These threads do not refer back to any other articles,
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8042 ;; so they're roots.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8043 (setq threads (append (cdr (symbol-value refs)) threads))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8044 gnus-newsgroup-dependencies)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8045 threads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8046
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8047 (defun gnus-build-sparse-threads ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8048 (let ((headers gnus-newsgroup-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8049 (deps gnus-newsgroup-dependencies)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8050 header references generation relations
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8051 cthread subject child end pthread relation)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8052 ;; First we create an alist of generations/relations, where
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8053 ;; generations is how much we trust the ralation, and the relation
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8054 ;; is parent/child.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8055 (gnus-message 7 "Making sparse threads...")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8056 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8057 (nnheader-set-temp-buffer " *gnus sparse threads*")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8058 (while (setq header (pop headers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8059 (when (and (setq references (mail-header-references header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8060 (not (string= references "")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8061 (insert references)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8062 (setq child (mail-header-id header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8063 subject (mail-header-subject header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8064 (setq generation 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8065 (while (search-backward ">" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8066 (setq end (1+ (point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8067 (when (search-backward "<" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8068 (push (list (incf generation)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8069 child (setq child (buffer-substring (point) end))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8070 subject)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8071 relations)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8072 (push (list (1+ generation) child nil subject) relations)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8073 (erase-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8074 (kill-buffer (current-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8075 ;; Sort over trustworthiness.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8076 (setq relations (sort relations (lambda (r1 r2) (< (car r1) (car r2)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8077 (while (setq relation (pop relations))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8078 (when (if (boundp (setq cthread (intern (cadr relation) deps)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8079 (unless (car (symbol-value cthread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8080 ;; Make this article the parent of these threads.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8081 (setcar (symbol-value cthread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8082 (vector gnus-reffed-article-number
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8083 (cadddr relation)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8084 "" ""
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8085 (cadr relation)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8086 (or (caddr relation) "") 0 0 "")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8087 (set cthread (list (vector gnus-reffed-article-number
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8088 (cadddr relation)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8089 "" "" (cadr relation)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8090 (or (caddr relation) "") 0 0 ""))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8091 (push gnus-reffed-article-number gnus-newsgroup-limit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8092 (push gnus-reffed-article-number gnus-newsgroup-sparse)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8093 (push (cons gnus-reffed-article-number gnus-sparse-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8094 gnus-newsgroup-reads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8095 (decf gnus-reffed-article-number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8096 ;; Make this new thread the child of its parent.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8097 (if (boundp (setq pthread (intern (or (caddr relation) "none") deps)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8098 (setcdr (symbol-value pthread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8099 (nconc (cdr (symbol-value pthread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8100 (list (symbol-value cthread))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8101 (set pthread (list nil (symbol-value cthread))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8102 (gnus-message 7 "Making sparse threads...done")))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8103
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8104 (defun gnus-build-old-threads ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8105 ;; 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
8106 ;; 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
8107 ;; 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
8108 ;; server, that is.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8109 (let (id heads)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8110 (mapatoms
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8111 (lambda (refs)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8112 (when (not (car (symbol-value refs)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8113 (setq heads (cdr (symbol-value refs)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8114 (while heads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8115 (if (memq (mail-header-number (caar heads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8116 gnus-newsgroup-dormant)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8117 (setq heads (cdr heads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8118 (setq id (symbol-name refs))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8119 (while (and (setq id (gnus-build-get-header id))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8120 (not (car (gnus-gethash
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8121 id gnus-newsgroup-dependencies)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8122 (setq heads nil)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8123 gnus-newsgroup-dependencies)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8124
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8125 (defun gnus-build-get-header (id)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8126 ;; 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
8127 ;; 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
8128 ;; the id of the parent article (if any).
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8129 (let ((deps gnus-newsgroup-dependencies)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8130 found header)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8131 (prog1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8132 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8133 (set-buffer nntp-server-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8134 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8135 (while (and (not found) (search-forward id nil t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8136 (beginning-of-line)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8137 (setq found (looking-at
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8138 (format "^[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t%s"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8139 (regexp-quote id))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8140 (or found (beginning-of-line 2)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8141 (when found
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8142 (beginning-of-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8143 (and
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8144 (setq header (gnus-nov-parse-line
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8145 (read (current-buffer)) deps))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8146 (gnus-parent-id (mail-header-references header)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8147 (when header
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8148 (let ((number (mail-header-number header)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8149 (push number gnus-newsgroup-limit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8150 (push header gnus-newsgroup-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8151 (if (memq number gnus-newsgroup-unselected)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8152 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8153 (push number gnus-newsgroup-unreads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8154 (setq gnus-newsgroup-unselected
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8155 (delq number gnus-newsgroup-unselected)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8156 (push number gnus-newsgroup-ancient)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8157
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8158 (defun gnus-summary-update-article (article &optional iheader)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8159 "Update ARTICLE in the summary buffer."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8160 (set-buffer gnus-summary-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8161 (let* ((header (or iheader (gnus-summary-article-header article)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8162 (id (mail-header-id header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8163 (data (gnus-data-find article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8164 (thread (gnus-id-to-thread id))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8165 (references (mail-header-references header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8166 (parent
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8167 (gnus-id-to-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8168 (or (gnus-parent-id
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8169 (if (and references
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8170 (not (equal "" references)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8171 references))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8172 "none")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8173 (buffer-read-only nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8174 (old (car thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8175 (number (mail-header-number header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8176 pos)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8177 (when thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8178 ;; !!! Should this be in or not?
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8179 (unless iheader
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8180 (setcar thread nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8181 (when parent
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8182 (delq thread parent))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8183 (if (gnus-summary-insert-subject id header iheader)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8184 ;; Set the (possibly) new article number in the data structure.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8185 (gnus-data-set-number data (gnus-id-to-article id))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8186 (setcar thread old)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8187 nil))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8188
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8189 (defun gnus-rebuild-thread (id)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8190 "Rebuild the thread containing ID."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8191 (let ((buffer-read-only nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8192 current thread data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8193 (if (not gnus-show-threads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8194 (setq thread (list (car (gnus-id-to-thread id))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8195 ;; Get the thread this article is part of.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8196 (setq thread (gnus-remove-thread id)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8197 (setq current (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8198 (and (zerop (forward-line -1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8199 (gnus-summary-article-number))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8200 ;; 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
8201 (when (stringp (car thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8202 (let ((subject (car thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8203 roots thr)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8204 (setq thread (cdr thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8205 (while thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8206 (unless (memq (setq thr (gnus-id-to-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8207 (gnus-root-id
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8208 (mail-header-id (caar thread)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8209 roots)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8210 (push thr roots))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8211 (setq thread (cdr thread)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8212 ;; We now have all (unique) roots.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8213 (if (= (length roots) 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8214 ;; All the loose roots are now one solid root.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8215 (setq thread (car roots))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8216 (setq thread (cons subject (gnus-sort-threads roots))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8217 (let (threads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8218 ;; We then insert this thread into the summary buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8219 (let (gnus-newsgroup-data gnus-newsgroup-threads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8220 (gnus-summary-prepare-threads (gnus-cut-threads (list thread)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8221 (setq data (nreverse gnus-newsgroup-data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8222 (setq threads gnus-newsgroup-threads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8223 ;; We splice the new data into the data structure.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8224 (gnus-data-enter-list current data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8225 (gnus-data-compute-positions)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8226 (setq gnus-newsgroup-threads (nconc threads gnus-newsgroup-threads)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8227
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8228 (defun gnus-number-to-header (number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8229 "Return the header for article NUMBER."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8230 (let ((headers gnus-newsgroup-headers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8231 (while (and headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8232 (not (= number (mail-header-number (car headers)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8233 (pop headers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8234 (when headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8235 (car headers))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8236
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8237 (defun gnus-id-to-thread (id)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8238 "Return the (sub-)thread where ID appears."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8239 (gnus-gethash id gnus-newsgroup-dependencies))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8240
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8241 (defun gnus-id-to-article (id)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8242 "Return the article number of ID."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8243 (let ((thread (gnus-id-to-thread id)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8244 (when (and thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8245 (car thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8246 (mail-header-number (car thread)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8247
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8248 (defun gnus-id-to-header (id)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8249 "Return the article headers of ID."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8250 (car (gnus-id-to-thread id)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8251
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8252 (defun gnus-article-displayed-root-p (article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8253 "Say whether ARTICLE is a root(ish) article."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8254 (let ((level (gnus-summary-thread-level article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8255 (refs (mail-header-references (gnus-summary-article-header article)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8256 particle)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8257 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8258 ((null level) nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8259 ((zerop level) t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8260 ((null refs) t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8261 ((null (gnus-parent-id refs)) t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8262 ((and (= 1 level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8263 (null (setq particle (gnus-id-to-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8264 (gnus-parent-id refs))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8265 (null (gnus-summary-thread-level particle)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8266
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8267 (defun gnus-root-id (id)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8268 "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
8269 (let (last-id prev)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8270 (while (and id (setq prev (car (gnus-gethash
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8271 id gnus-newsgroup-dependencies))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8272 (setq last-id id
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8273 id (gnus-parent-id (mail-header-references prev))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8274 last-id))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8275
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8276 (defun gnus-remove-thread (id &optional dont-remove)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8277 "Remove the thread that has ID in it."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8278 (let ((dep gnus-newsgroup-dependencies)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8279 headers thread last-id)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8280 ;; First go up in this thread until we find the root.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8281 (setq last-id (gnus-root-id id))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8282 (setq headers (list (car (gnus-id-to-thread last-id))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8283 (caadr (gnus-id-to-thread last-id))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8284 ;; 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
8285 ;; been gathered into some loose thread, so we have to search
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8286 ;; through the threads to find the thread we wanted.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8287 (let ((threads gnus-newsgroup-threads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8288 sub)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8289 (while threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8290 (setq sub (car threads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8291 (if (stringp (car sub))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8292 ;; This is a gathered threads, so we look at the roots
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8293 ;; below it to find whether this article in in this
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8294 ;; gathered root.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8295 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8296 (setq sub (cdr sub))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8297 (while sub
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8298 (when (member (caar sub) headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8299 (setq thread (car threads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8300 threads nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8301 sub nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8302 (setq sub (cdr sub))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8303 ;; It's an ordinary thread, so we check it.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8304 (when (eq (car sub) (car headers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8305 (setq thread sub
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8306 threads nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8307 (setq threads (cdr threads)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8308 ;; 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
8309 (if thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8310 (unless dont-remove
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8311 (setq gnus-newsgroup-threads (delq thread gnus-newsgroup-threads)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8312 (setq thread (gnus-gethash last-id dep)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8313 (when thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8314 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8315 thread ; We return this thread.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8316 (unless dont-remove
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8317 (if (stringp (car thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8318 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8319 ;; If we use dummy roots, then we have to remove the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8320 ;; dummy root as well.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8321 (when (eq gnus-summary-make-false-root 'dummy)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8322 ;; Uhm.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8323 )
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8324 (setq thread (cdr thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8325 (while thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8326 (gnus-remove-thread-1 (car thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8327 (setq thread (cdr thread))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8328 (gnus-remove-thread-1 thread))))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8329
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8330 (defun gnus-remove-thread-1 (thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8331 "Remove the thread THREAD recursively."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8332 (let ((number (mail-header-number (car thread)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8333 pos)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8334 (when (setq pos (text-property-any
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8335 (point-min) (point-max) 'gnus-number number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8336 (goto-char pos)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8337 (gnus-delete-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8338 (gnus-data-remove number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8339 (setq thread (cdr thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8340 (while thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8341 (gnus-remove-thread-1 (pop thread)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8342
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8343 (defun gnus-sort-threads (threads)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8344 "Sort THREADS."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8345 (if (not gnus-thread-sort-functions)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8346 threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8347 (let ((func (if (= 1 (length gnus-thread-sort-functions))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8348 (car gnus-thread-sort-functions)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8349 `(lambda (t1 t2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8350 ,(gnus-make-sort-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8351 (reverse gnus-thread-sort-functions))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8352 (gnus-message 7 "Sorting threads...")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8353 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8354 (sort threads func)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8355 (gnus-message 7 "Sorting threads...done")))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8356
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8357 (defun gnus-sort-articles (articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8358 "Sort ARTICLES."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8359 (when gnus-article-sort-functions
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8360 (let ((func (if (= 1 (length gnus-article-sort-functions))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8361 (car gnus-article-sort-functions)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8362 `(lambda (t1 t2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8363 ,(gnus-make-sort-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8364 (reverse gnus-article-sort-functions))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8365 (gnus-message 7 "Sorting articles...")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8366 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8367 (setq gnus-newsgroup-headers (sort articles func))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8368 (gnus-message 7 "Sorting articles...done")))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8369
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8370 (defun gnus-make-sort-function (funs)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8371 "Return a composite sort condition based on the functions in FUNC."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8372 (if (cdr funs)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8373 `(or (,(car funs) t1 t2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8374 (and (not (,(car funs) t2 t1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8375 ,(gnus-make-sort-function (cdr funs))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8376 `(,(car funs) t1 t2)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8377
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8378 ;; Written by Hallvard B Furuseth <h.b.furuseth@usit.uio.no>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8379 (defmacro gnus-thread-header (thread)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8380 ;; Return header of first article in THREAD.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8381 ;; 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
8382 ;; using some other form will lead to serious barfage.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8383 (or (symbolp thread) (signal 'wrong-type-argument '(symbolp thread)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8384 ;; (8% speedup to gnus-summary-prepare, just for fun :-)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8385 (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
8386 (vector thread) 2))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8387
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8388 (defsubst gnus-article-sort-by-number (h1 h2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8389 "Sort articles by article number."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8390 (< (mail-header-number h1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8391 (mail-header-number h2)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8392
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8393 (defun gnus-thread-sort-by-number (h1 h2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8394 "Sort threads by root article number."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8395 (gnus-article-sort-by-number
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8396 (gnus-thread-header h1) (gnus-thread-header h2)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8397
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8398 (defsubst gnus-article-sort-by-author (h1 h2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8399 "Sort articles by root author."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8400 (string-lessp
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8401 (let ((extract (funcall
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8402 gnus-extract-address-components
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8403 (mail-header-from h1))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8404 (or (car extract) (cdr extract)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8405 (let ((extract (funcall
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8406 gnus-extract-address-components
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8407 (mail-header-from h2))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8408 (or (car extract) (cdr extract)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8409
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8410 (defun gnus-thread-sort-by-author (h1 h2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8411 "Sort threads by root author."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8412 (gnus-article-sort-by-author
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8413 (gnus-thread-header h1) (gnus-thread-header h2)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8414
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8415 (defsubst gnus-article-sort-by-subject (h1 h2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8416 "Sort articles by root subject."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8417 (string-lessp
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8418 (downcase (gnus-simplify-subject-re (mail-header-subject h1)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8419 (downcase (gnus-simplify-subject-re (mail-header-subject h2)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8420
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8421 (defun gnus-thread-sort-by-subject (h1 h2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8422 "Sort threads by root subject."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8423 (gnus-article-sort-by-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8424 (gnus-thread-header h1) (gnus-thread-header h2)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8425
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8426 (defsubst gnus-article-sort-by-date (h1 h2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8427 "Sort articles by root article date."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8428 (string-lessp
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8429 (inline (gnus-sortable-date (mail-header-date h1)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8430 (inline (gnus-sortable-date (mail-header-date h2)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8431
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8432 (defun gnus-thread-sort-by-date (h1 h2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8433 "Sort threads by root article date."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8434 (gnus-article-sort-by-date
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8435 (gnus-thread-header h1) (gnus-thread-header h2)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8436
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8437 (defsubst gnus-article-sort-by-score (h1 h2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8438 "Sort articles by root article score.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8439 Unscored articles will be counted as having a score of zero."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8440 (> (or (cdr (assq (mail-header-number h1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8441 gnus-newsgroup-scored))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8442 gnus-summary-default-score 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8443 (or (cdr (assq (mail-header-number h2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8444 gnus-newsgroup-scored))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8445 gnus-summary-default-score 0)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8446
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8447 (defun gnus-thread-sort-by-score (h1 h2)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8448 "Sort threads by root article score."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8449 (gnus-article-sort-by-score
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8450 (gnus-thread-header h1) (gnus-thread-header h2)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8451
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8452 (defun gnus-thread-sort-by-total-score (h1 h2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8453 "Sort threads by the sum of all scores in the thread.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8454 Unscored articles will be counted as having a score of zero."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8455 (> (gnus-thread-total-score h1) (gnus-thread-total-score h2)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8456
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8457 (defun gnus-thread-total-score (thread)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8458 ;; This function find the total score of THREAD.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8459 (cond ((null thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8460 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8461 ((consp thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8462 (if (stringp (car thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8463 (apply gnus-thread-score-function 0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8464 (mapcar 'gnus-thread-total-score-1 (cdr thread)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8465 (gnus-thread-total-score-1 thread)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8466 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8467 (gnus-thread-total-score-1 (list thread)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8468
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8469 (defun gnus-thread-total-score-1 (root)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8470 ;; This function find the total score of the thread below ROOT.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8471 (setq root (car root))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8472 (apply gnus-thread-score-function
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
8473 (or (append
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
8474 (mapcar 'gnus-thread-total-score
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
8475 (cdr (gnus-gethash (mail-header-id root)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
8476 gnus-newsgroup-dependencies)))
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
8477 (if (> (mail-header-number root) 0)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
8478 (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
8479 gnus-newsgroup-scored))
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
8480 gnus-summary-default-score 0))))
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
8481 (list gnus-summary-default-score)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
8482 '(0))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8483
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8484 ;; Added by Per Abrahamsen <amanda@iesd.auc.dk>.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8485 (defvar gnus-tmp-prev-subject nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8486 (defvar gnus-tmp-false-parent nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8487 (defvar gnus-tmp-root-expunged nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8488 (defvar gnus-tmp-dummy-line nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8489
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8490 (defun gnus-summary-prepare-threads (threads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8491 "Prepare summary buffer from THREADS and indentation LEVEL.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8492 THREADS is either a list of `(PARENT [(CHILD1 [(GRANDCHILD ...]...) ...])'
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8493 or a straight list of headers."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8494 (gnus-message 7 "Generating summary...")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8495
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8496 (setq gnus-newsgroup-threads threads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8497 (beginning-of-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8498
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8499 (let ((gnus-tmp-level 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8500 (default-score (or gnus-summary-default-score 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8501 (gnus-visual-p (gnus-visual-p 'summary-highlight 'highlight))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8502 thread number subject stack state gnus-tmp-gathered beg-match
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8503 new-roots gnus-tmp-new-adopts thread-end
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8504 gnus-tmp-header gnus-tmp-unread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8505 gnus-tmp-replied gnus-tmp-subject-or-nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8506 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
8507 gnus-tmp-score-char gnus-tmp-from gnus-tmp-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8508 gnus-tmp-number gnus-tmp-opening-bracket gnus-tmp-closing-bracket)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8509
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8510 (setq gnus-tmp-prev-subject nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8511
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8512 (if (vectorp (car threads))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8513 ;; If this is a straight (sic) list of headers, then a
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8514 ;; threaded summary display isn't required, so we just create
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8515 ;; an unthreaded one.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8516 (gnus-summary-prepare-unthreaded threads)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8517
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8518 ;; Do the threaded display.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8519
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8520 (while (or threads stack gnus-tmp-new-adopts new-roots)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8521
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8522 (if (and (= gnus-tmp-level 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8523 (not (setq gnus-tmp-dummy-line nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8524 (or (not stack)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8525 (= (caar stack) 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8526 (not gnus-tmp-false-parent)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8527 (or gnus-tmp-new-adopts new-roots))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8528 (if gnus-tmp-new-adopts
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8529 (setq gnus-tmp-level (if gnus-tmp-root-expunged 0 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8530 thread (list (car gnus-tmp-new-adopts))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8531 gnus-tmp-header (caar thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8532 gnus-tmp-new-adopts (cdr gnus-tmp-new-adopts))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8533 (if new-roots
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8534 (setq thread (list (car new-roots))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8535 gnus-tmp-header (caar thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8536 new-roots (cdr new-roots))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8537
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8538 (if threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8539 ;; If there are some threads, we do them before the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8540 ;; threads on the stack.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8541 (setq thread threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8542 gnus-tmp-header (caar thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8543 ;; There were no current threads, so we pop something off
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8544 ;; the stack.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8545 (setq state (car stack)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8546 gnus-tmp-level (car state)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8547 thread (cdr state)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8548 stack (cdr stack)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8549 gnus-tmp-header (caar thread))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8550
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8551 (setq gnus-tmp-false-parent nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8552 (setq gnus-tmp-root-expunged nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8553 (setq thread-end nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8554
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8555 (if (stringp gnus-tmp-header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8556 ;; The header is a dummy root.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8557 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8558 ((eq gnus-summary-make-false-root 'adopt)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8559 ;; We let the first article adopt the rest.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8560 (setq gnus-tmp-new-adopts (nconc gnus-tmp-new-adopts
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8561 (cddar thread)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8562 (setq gnus-tmp-gathered
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8563 (nconc (mapcar
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8564 (lambda (h) (mail-header-number (car h)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8565 (cddar thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8566 gnus-tmp-gathered))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8567 (setq thread (cons (list (caar thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8568 (cadar thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8569 (cdr thread)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8570 (setq gnus-tmp-level -1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8571 gnus-tmp-false-parent t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8572 ((eq gnus-summary-make-false-root 'empty)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8573 ;; We print adopted articles with empty subject fields.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8574 (setq gnus-tmp-gathered
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8575 (nconc (mapcar
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8576 (lambda (h) (mail-header-number (car h)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8577 (cddar thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8578 gnus-tmp-gathered))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8579 (setq gnus-tmp-level -1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8580 ((eq gnus-summary-make-false-root 'dummy)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8581 ;; We remember that we probably want to output a dummy
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8582 ;; root.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8583 (setq gnus-tmp-dummy-line gnus-tmp-header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8584 (setq gnus-tmp-prev-subject gnus-tmp-header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8585 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8586 ;; We do not make a root for the gathered
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8587 ;; sub-threads at all.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8588 (setq gnus-tmp-level -1)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8589
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8590 (setq number (mail-header-number gnus-tmp-header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8591 subject (mail-header-subject gnus-tmp-header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8592
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8593 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8594 ;; If the thread has changed subject, we might want to make
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8595 ;; this subthread into a root.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8596 ((and (null gnus-thread-ignore-subject)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8597 (not (zerop gnus-tmp-level))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8598 gnus-tmp-prev-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8599 (not (inline
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8600 (gnus-subject-equal gnus-tmp-prev-subject subject))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8601 (setq new-roots (nconc new-roots (list (car thread)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8602 thread-end t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8603 gnus-tmp-header nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8604 ;; If the article lies outside the current limit,
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8605 ;; then we do not display it.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8606 ((and (not (memq number gnus-newsgroup-limit))
15594
d4c3b52a5591 Would infloop under certain conditions.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15577
diff changeset
8607 (not gnus-tmp-dummy-line))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8608 (setq gnus-tmp-gathered
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8609 (nconc (mapcar
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8610 (lambda (h) (mail-header-number (car h)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8611 (cdar thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8612 gnus-tmp-gathered))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8613 (setq gnus-tmp-new-adopts (if (cdar thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8614 (append gnus-tmp-new-adopts
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8615 (cdar thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8616 gnus-tmp-new-adopts)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8617 thread-end t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8618 gnus-tmp-header nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8619 (when (zerop gnus-tmp-level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8620 (setq gnus-tmp-root-expunged t)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8621 ;; Perhaps this article is to be marked as read?
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8622 ((and gnus-summary-mark-below
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8623 (< (or (cdr (assq number gnus-newsgroup-scored))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8624 default-score)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8625 gnus-summary-mark-below)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8626 ;; Don't touch sparse articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8627 (not (memq number gnus-newsgroup-sparse))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8628 (not (memq number gnus-newsgroup-ancient)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8629 (setq gnus-newsgroup-unreads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8630 (delq number gnus-newsgroup-unreads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8631 (if gnus-newsgroup-auto-expire
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8632 (push number gnus-newsgroup-expirable)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8633 (push (cons number gnus-low-score-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8634 gnus-newsgroup-reads))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8635
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8636 (when gnus-tmp-header
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8637 ;; We may have an old dummy line to output before this
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8638 ;; article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8639 (when gnus-tmp-dummy-line
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8640 (gnus-summary-insert-dummy-line
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8641 gnus-tmp-dummy-line (mail-header-number gnus-tmp-header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8642 (setq gnus-tmp-dummy-line nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8643
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8644 ;; Compute the mark.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8645 (setq
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8646 gnus-tmp-unread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8647 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8648 ((memq number gnus-newsgroup-unreads) gnus-unread-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8649 ((memq number gnus-newsgroup-marked) gnus-ticked-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8650 ((memq number gnus-newsgroup-dormant) gnus-dormant-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8651 ((memq number gnus-newsgroup-expirable) gnus-expirable-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8652 (t (or (cdr (assq number gnus-newsgroup-reads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8653 gnus-ancient-mark))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8654
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8655 (push (gnus-data-make number gnus-tmp-unread (1+ (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8656 gnus-tmp-header gnus-tmp-level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8657 gnus-newsgroup-data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8658
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8659 ;; Actually insert the line.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8660 (setq
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8661 gnus-tmp-subject-or-nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8662 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8663 ((and gnus-thread-ignore-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8664 gnus-tmp-prev-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8665 (not (inline (gnus-subject-equal
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8666 gnus-tmp-prev-subject subject))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8667 subject)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8668 ((zerop gnus-tmp-level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8669 (if (and (eq gnus-summary-make-false-root 'empty)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8670 (memq number gnus-tmp-gathered)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8671 gnus-tmp-prev-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8672 (inline (gnus-subject-equal
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8673 gnus-tmp-prev-subject subject)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8674 gnus-summary-same-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8675 subject))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8676 (t gnus-summary-same-subject)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8677 (if (and (eq gnus-summary-make-false-root 'adopt)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8678 (= gnus-tmp-level 1)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8679 (memq number gnus-tmp-gathered))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8680 (setq gnus-tmp-opening-bracket ?\<
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8681 gnus-tmp-closing-bracket ?\>)
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
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8685 gnus-tmp-indentation
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8686 (aref gnus-thread-indent-array gnus-tmp-level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8687 gnus-tmp-lines (mail-header-lines gnus-tmp-header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8688 gnus-tmp-score (or (cdr (assq number gnus-newsgroup-scored))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8689 gnus-summary-default-score 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8690 gnus-tmp-score-char
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8691 (if (or (null gnus-summary-default-score)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8692 (<= (abs (- gnus-tmp-score gnus-summary-default-score))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8693 gnus-summary-zcore-fuzz)) ?
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8694 (if (< gnus-tmp-score gnus-summary-default-score)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8695 gnus-score-below-mark gnus-score-over-mark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8696 gnus-tmp-replied
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8697 (cond ((memq number gnus-newsgroup-processable)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8698 gnus-process-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8699 ((memq number gnus-newsgroup-cached)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8700 gnus-cached-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8701 ((memq number gnus-newsgroup-replied)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8702 gnus-replied-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8703 ((memq number gnus-newsgroup-saved)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8704 gnus-saved-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8705 (t gnus-unread-mark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8706 gnus-tmp-from (mail-header-from gnus-tmp-header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8707 gnus-tmp-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8708 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8709 ((string-match "(.+)" gnus-tmp-from)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8710 (substring gnus-tmp-from
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8711 (1+ (match-beginning 0)) (1- (match-end 0))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8712 ((string-match "<[^>]+> *$" gnus-tmp-from)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8713 (setq beg-match (match-beginning 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8714 (or (and (string-match "^\"[^\"]*\"" gnus-tmp-from)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8715 (substring gnus-tmp-from (1+ (match-beginning 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8716 (1- (match-end 0))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8717 (substring gnus-tmp-from 0 beg-match)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8718 (t gnus-tmp-from)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8719 (when (string= gnus-tmp-name "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8720 (setq gnus-tmp-name gnus-tmp-from))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8721 (or (numberp gnus-tmp-lines) (setq gnus-tmp-lines 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8722 (gnus-put-text-property
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8723 (point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8724 (progn (eval gnus-summary-line-format-spec) (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8725 'gnus-number number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8726 (when gnus-visual-p
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8727 (forward-line -1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8728 (run-hooks 'gnus-summary-update-hook)
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
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8731 (setq gnus-tmp-prev-subject subject)))
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 (when (nth 1 thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8734 (push (cons (max 0 gnus-tmp-level) (nthcdr 1 thread)) stack))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8735 (incf gnus-tmp-level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8736 (setq threads (if thread-end nil (cdar thread)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8737 (unless threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8738 (setq gnus-tmp-level 0)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8739 (gnus-message 7 "Generating summary...done"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8740
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8741 (defun gnus-summary-prepare-unthreaded (headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8742 "Generate an unthreaded summary buffer based on HEADERS."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8743 (let (header number mark)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8744
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8745 (while headers
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8746 ;; We may have to root out some bad articles...
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8747 (when (memq (setq number (mail-header-number
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8748 (setq header (pop headers))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8749 gnus-newsgroup-limit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8750 ;; Mark article as read when it has a low score.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8751 (when (and gnus-summary-mark-below
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8752 (< (or (cdr (assq number gnus-newsgroup-scored))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8753 gnus-summary-default-score 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8754 gnus-summary-mark-below)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8755 (not (memq number gnus-newsgroup-ancient)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8756 (setq gnus-newsgroup-unreads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8757 (delq number gnus-newsgroup-unreads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8758 (if gnus-newsgroup-auto-expire
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8759 (push number gnus-newsgroup-expirable)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8760 (push (cons number gnus-low-score-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8761 gnus-newsgroup-reads)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8762
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8763 (setq mark
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8764 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8765 ((memq number gnus-newsgroup-marked) gnus-ticked-mark)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8766 ((memq number gnus-newsgroup-dormant) gnus-dormant-mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8767 ((memq number gnus-newsgroup-unreads) gnus-unread-mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8768 ((memq number gnus-newsgroup-expirable) gnus-expirable-mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8769 (t (or (cdr (assq number gnus-newsgroup-reads))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8770 gnus-ancient-mark))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8771 (setq gnus-newsgroup-data
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8772 (cons (gnus-data-make number mark (1+ (point)) header 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8773 gnus-newsgroup-data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8774 (gnus-summary-insert-line
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8775 header 0 nil mark (memq number gnus-newsgroup-replied)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8776 (memq number gnus-newsgroup-expirable)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8777 (mail-header-subject header) nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8778 (cdr (assq number gnus-newsgroup-scored))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8779 (memq number gnus-newsgroup-processable))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8780
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8781 (defun gnus-select-newsgroup (group &optional read-all)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8782 "Select newsgroup GROUP.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8783 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
8784 (let* ((entry (gnus-gethash group gnus-newsrc-hashtb))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8785 (info (nth 2 entry))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8786 articles fetched-articles cached)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8787
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8788 (or (gnus-check-server
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8789 (setq gnus-current-select-method (gnus-find-method-for-group group)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8790 (error "Couldn't open server"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8791
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8792 (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
8793 (gnus-activate-group group) ; Or we can activate it...
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8794 (progn ; Or we bug out.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8795 (when (equal major-mode 'gnus-summary-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8796 (kill-buffer (current-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8797 (error "Couldn't request group %s: %s"
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8798 group (gnus-status-message group))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8799
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8800 (unless (gnus-request-group group t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8801 (when (equal major-mode 'gnus-summary-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8802 (kill-buffer (current-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8803 (error "Couldn't request group %s: %s"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8804 group (gnus-status-message group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8805
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8806 (setq gnus-newsgroup-name group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8807 (setq gnus-newsgroup-unselected nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8808 (setq gnus-newsgroup-unreads (gnus-list-of-unread-articles group))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8809
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8810 (and gnus-asynchronous
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8811 (gnus-check-backend-function
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8812 'request-asynchronous gnus-newsgroup-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8813 (setq gnus-newsgroup-async
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8814 (gnus-request-asynchronous gnus-newsgroup-name)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8815
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8816 ;; Adjust and set lists of article marks.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8817 (when info
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8818 (gnus-adjust-marked-articles info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8819
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8820 ;; Kludge to avoid having cached articles nixed out in virtual groups.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8821 (when (gnus-virtual-group-p group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8822 (setq cached gnus-newsgroup-cached))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8823
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8824 (setq gnus-newsgroup-unreads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8825 (gnus-set-difference
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8826 (gnus-set-difference gnus-newsgroup-unreads gnus-newsgroup-marked)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8827 gnus-newsgroup-dormant))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8828
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8829 (setq gnus-newsgroup-processable nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8830
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8831 (setq articles (gnus-articles-to-read group read-all))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8832
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8833 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8834 ((null articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8835 ;;(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
8836 'quit)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8837 ((eq articles 0) nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8838 (t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8839 ;; Init the dependencies hash table.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8840 (setq gnus-newsgroup-dependencies
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8841 (gnus-make-hashtable (length articles)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8842 ;; Retrieve the headers and read them in.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8843 (gnus-message 5 "Fetching headers for %s..." gnus-newsgroup-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8844 (setq gnus-newsgroup-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8845 (if (eq 'nov
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8846 (setq gnus-headers-retrieved-by
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8847 (gnus-retrieve-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8848 articles gnus-newsgroup-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8849 ;; We might want to fetch old headers, but
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8850 ;; not if there is only 1 article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8851 (and gnus-fetch-old-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8852 (or (and
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8853 (not (eq gnus-fetch-old-headers 'some))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8854 (not (numberp gnus-fetch-old-headers)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8855 (> (length articles) 1))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8856 (gnus-get-newsgroup-headers-xover articles)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8857 (gnus-get-newsgroup-headers)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8858 (gnus-message 5 "Fetching headers for %s...done" gnus-newsgroup-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8859
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8860 ;; Kludge to avoid having cached articles nixed out in virtual groups.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8861 (when cached
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8862 (setq gnus-newsgroup-cached cached))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8863
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8864 ;; Set the initial limit.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8865 (setq gnus-newsgroup-limit (copy-sequence articles))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8866 ;; Remove canceled articles from the list of unread articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8867 (setq gnus-newsgroup-unreads
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8868 (gnus-set-sorted-intersection
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8869 gnus-newsgroup-unreads
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8870 (setq fetched-articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8871 (mapcar (lambda (headers) (mail-header-number headers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8872 gnus-newsgroup-headers))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8873 ;; Removed marked articles that do not exist.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8874 (gnus-update-missing-marks
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8875 (gnus-sorted-complement fetched-articles articles))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8876 ;; We might want to build some more threads first.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8877 (and gnus-fetch-old-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8878 (eq gnus-headers-retrieved-by 'nov)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8879 (gnus-build-old-threads))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8880 ;; Check whether auto-expire is to be done in this group.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8881 (setq gnus-newsgroup-auto-expire
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8882 (gnus-group-auto-expirable-p group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8883 ;; Set up the article buffer now, if necessary.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8884 (unless gnus-single-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8885 (gnus-article-setup-buffer))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8886 ;; First and last article in this newsgroup.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8887 (when gnus-newsgroup-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8888 (setq gnus-newsgroup-begin
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8889 (mail-header-number (car gnus-newsgroup-headers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8890 gnus-newsgroup-end
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8891 (mail-header-number
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8892 (gnus-last-element gnus-newsgroup-headers))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8893 (setq gnus-reffed-article-number -1)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8894 ;; GROUP is successfully selected.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8895 (or gnus-newsgroup-headers t)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8896
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8897 (defun gnus-articles-to-read (group read-all)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8898 ;; Find out what articles the user wants to read.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8899 (let* ((articles
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8900 ;; 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
8901 ;; are no unread articles.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8902 (if (or read-all
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8903 (and (zerop (length gnus-newsgroup-marked))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8904 (zerop (length gnus-newsgroup-unreads))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8905 (gnus-uncompress-range (gnus-active group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8906 (sort (append gnus-newsgroup-dormant gnus-newsgroup-marked
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8907 (copy-sequence gnus-newsgroup-unreads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8908 '<)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8909 (scored-list (gnus-killed-articles gnus-newsgroup-killed articles))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8910 (scored (length scored-list))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8911 (number (length articles))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8912 (marked (+ (length gnus-newsgroup-marked)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8913 (length gnus-newsgroup-dormant)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8914 (select
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8915 (cond
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8916 ((numberp read-all)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8917 read-all)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8918 (t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8919 (condition-case ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8920 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8921 ((and (or (<= scored marked) (= scored number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8922 (numberp gnus-large-newsgroup)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8923 (> number gnus-large-newsgroup))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8924 (let ((input
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8925 (read-string
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8926 (format
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8927 "How many articles from %s (default %d): "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8928 gnus-newsgroup-name number))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8929 (if (string-match "^[ \t]*$" input) number input)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8930 ((and (> scored marked) (< scored number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8931 (> (- scored number) 20))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8932 (let ((input
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8933 (read-string
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8934 (format "%s %s (%d scored, %d total): "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8935 "How many articles from"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8936 group scored number))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8937 (if (string-match "^[ \t]*$" input)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8938 number input)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8939 (t number))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8940 (quit nil))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8941 (setq select (if (stringp select) (string-to-number select) select))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8942 (if (or (null select) (zerop select))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8943 select
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8944 (if (and (not (zerop scored)) (<= (abs select) scored))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8945 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8946 (setq articles (sort scored-list '<))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8947 (setq number (length articles)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8948 (setq articles (copy-sequence articles)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8949
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8950 (if (< (abs select) number)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8951 (if (< select 0)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8952 ;; Select the N oldest articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8953 (setcdr (nthcdr (1- (abs select)) articles) nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8954 ;; Select the N most recent articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8955 (setq articles (nthcdr (- number select) articles))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8956 (setq gnus-newsgroup-unselected
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8957 (gnus-sorted-intersection
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8958 gnus-newsgroup-unreads
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8959 (gnus-sorted-complement gnus-newsgroup-unreads articles)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8960 articles)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8961
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8962 (defun gnus-killed-articles (killed articles)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8963 (let (out)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8964 (while articles
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8965 (if (inline (gnus-member-of-range (car articles) killed))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8966 (setq out (cons (car articles) out)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8967 (setq articles (cdr articles)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8968 out))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8969
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8970 (defun gnus-uncompress-marks (marks)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8971 "Uncompress the mark ranges in MARKS."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8972 (let ((uncompressed '(score bookmark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8973 out)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8974 (while marks
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8975 (if (memq (caar marks) uncompressed)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8976 (push (car marks) out)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8977 (push (cons (caar marks) (gnus-uncompress-range (cdar marks))) out))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8978 (setq marks (cdr marks)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8979 out))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8980
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8981 (defun gnus-adjust-marked-articles (info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8982 "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
8983 (let* ((marked-lists (gnus-info-marks info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8984 (active (gnus-active (gnus-info-group info)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8985 (min (car active))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8986 (max (cdr active))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8987 (types gnus-article-mark-lists)
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
8988 (uncompressed '(score bookmark killed))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8989 marks var articles article mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8990
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8991 (while marked-lists
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8992 (setq marks (pop marked-lists))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8993 (set (setq var (intern (format "gnus-newsgroup-%s"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8994 (car (rassq (setq mark (car marks))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8995 types)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8996 (if (memq (car marks) uncompressed) (cdr marks)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8997 (gnus-uncompress-range (cdr marks))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8998
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8999 (setq articles (symbol-value var))
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 ;; All articles have to be subsets of the active articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9002 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9003 ;; Adjust "simple" lists.
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
9004 ((memq mark '(tick dormant expirable reply save))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9005 (while articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9006 (when (or (< (setq article (pop articles)) min) (> article max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9007 (set var (delq article (symbol-value var))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9008 ;; Adjust assocs.
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
9009 ((memq mark uncompressed)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9010 (while articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9011 (when (or (not (consp (setq article (pop articles))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9012 (< (car article) min)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9013 (> (car article) max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9014 (set var (delq article (symbol-value var))))))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9015
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9016 (defun gnus-update-missing-marks (missing)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9017 "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
9018 (when missing
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9019 (let ((types gnus-article-mark-lists)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9020 var m)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9021 ;; Go through all types.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9022 (while types
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9023 (setq var (intern (format "gnus-newsgroup-%s" (car (pop types)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9024 (when (symbol-value var)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9025 ;; This list has articles. So we delete all missing articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9026 ;; from it.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9027 (setq m missing)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9028 (while m
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9029 (set var (delq (pop m) (symbol-value var)))))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9030
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9031 (defun gnus-update-marks ()
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9032 "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
9033 (let ((types gnus-article-mark-lists)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9034 (info (gnus-get-info gnus-newsgroup-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9035 (uncompressed '(score bookmark killed))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9036 type list newmarked symbol)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9037 (when info
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9038 ;; 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
9039 (while types
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9040 (setq type (pop types))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9041 (when (setq list (symbol-value
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9042 (setq symbol
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9043 (intern (format "gnus-newsgroup-%s"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9044 (car type))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9045 (push (cons (cdr type)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9046 (if (memq (cdr type) uncompressed) list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9047 (gnus-compress-sequence
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9048 (set symbol (sort list '<)) t)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9049 newmarked)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9050
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9051 ;; Enter these new marks into the info of the group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9052 (if (nthcdr 3 info)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9053 (setcar (nthcdr 3 info) newmarked)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9054 ;; Add the marks lists to the end of the info.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9055 (when newmarked
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9056 (setcdr (nthcdr 2 info) (list newmarked))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9057
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9058 ;; 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
9059 (let ((i 5))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9060 (while (and (> i 2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9061 (not (nth i info)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9062 (when (nthcdr (decf i) info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9063 (setcdr (nthcdr i info) nil)))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9064
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9065 (defun gnus-add-marked-articles (group type articles &optional info force)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9066 ;; Add ARTICLES of TYPE to the info of GROUP.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9067 ;; 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
9068 ;; add, but replace marked articles of TYPE with ARTICLES.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9069 (let ((info (or info (gnus-get-info group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9070 (uncompressed '(score bookmark killed))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9071 marked m)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9072 (or (not info)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9073 (and (not (setq marked (nthcdr 3 info)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9074 (or (null articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9075 (setcdr (nthcdr 2 info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9076 (list (list (cons type (gnus-compress-sequence
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9077 articles t)))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9078 (and (not (setq m (assq type (car marked))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9079 (or (null articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9080 (setcar marked
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9081 (cons (cons type (gnus-compress-sequence articles t) )
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9082 (car marked)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9083 (if force
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9084 (if (null articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9085 (setcar (nthcdr 3 info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9086 (delq (assq type (car marked)) (car marked)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9087 (setcdr m (gnus-compress-sequence articles t)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9088 (setcdr m (gnus-compress-sequence
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9089 (sort (nconc (gnus-uncompress-range (cdr m))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9090 (copy-sequence articles)) '<) t))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9091
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9092 (defun gnus-set-mode-line (where)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9093 "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
9094 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
9095 ;; Is this mode line one we keep updated?
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9096 (when (memq where gnus-updated-mode-lines)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9097 (let (mode-string)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9098 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9099 ;; We evaluate this in the summary buffer since these
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9100 ;; variables are buffer-local to that buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9101 (set-buffer gnus-summary-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9102 ;; 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
9103 ;; below.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9104 (let* ((mformat (symbol-value
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9105 (intern
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9106 (format "gnus-%s-mode-line-format-spec" where))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9107 (gnus-tmp-group-name gnus-newsgroup-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9108 (gnus-tmp-article-number (or gnus-current-article 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9109 (gnus-tmp-unread gnus-newsgroup-unreads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9110 (gnus-tmp-unread-and-unticked (length gnus-newsgroup-unreads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9111 (gnus-tmp-unselected (length gnus-newsgroup-unselected))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9112 (gnus-tmp-unread-and-unselected
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9113 (cond ((and (zerop gnus-tmp-unread-and-unticked)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9114 (zerop gnus-tmp-unselected)) "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9115 ((zerop gnus-tmp-unselected)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9116 (format "{%d more}" gnus-tmp-unread-and-unticked))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9117 (t (format "{%d(+%d) more}"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9118 gnus-tmp-unread-and-unticked
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9119 gnus-tmp-unselected))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9120 (gnus-tmp-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9121 (if (and gnus-current-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9122 (vectorp gnus-current-headers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9123 (gnus-mode-string-quote
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9124 (mail-header-subject gnus-current-headers)) ""))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9125 max-len
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9126 gnus-tmp-header);; passed as argument to any user-format-funcs
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9127 (setq mode-string (eval mformat))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9128 (setq max-len (max 4 (if gnus-mode-non-string-length
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9129 (- (window-width)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9130 gnus-mode-non-string-length)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9131 (length mode-string))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9132 ;; We might have to chop a bit of the string off...
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9133 (when (> (length mode-string) max-len)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9134 (setq mode-string
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9135 (concat (gnus-truncate-string mode-string (- max-len 3))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9136 "...")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9137 ;; Pad the mode string a bit.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9138 (setq mode-string (format (format "%%-%ds" max-len) mode-string))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9139 ;; Update the mode line.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9140 (setq mode-line-buffer-identification
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9141 (gnus-mode-line-buffer-identification
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9142 (list mode-string)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9143 (set-buffer-modified-p t))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9144
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9145 (defun gnus-create-xref-hashtb (from-newsgroup headers unreads)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9146 "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
9147 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
9148 (let* ((virtual (gnus-virtual-group-p from-newsgroup))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9149 (prefix (if virtual "" (gnus-group-real-prefix from-newsgroup)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9150 (xref-hashtb (make-vector 63 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9151 start group entry number xrefs header)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9152 (while headers
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9153 (setq header (pop headers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9154 (when (and (setq xrefs (mail-header-xref header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9155 (not (memq (setq number (mail-header-number header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9156 unreads)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9157 (setq start 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9158 (while (string-match "\\([^ ]+\\)[:/]\\([0-9]+\\)" xrefs start)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9159 (setq start (match-end 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9160 (setq group (if prefix
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9161 (concat prefix (substring xrefs (match-beginning 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9162 (match-end 1)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9163 (substring xrefs (match-beginning 1) (match-end 1))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9164 (setq number
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9165 (string-to-int (substring xrefs (match-beginning 2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9166 (match-end 2))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9167 (if (setq entry (gnus-gethash group xref-hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9168 (setcdr entry (cons number (cdr entry)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9169 (gnus-sethash group (cons number nil) xref-hashtb)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9170 (and start xref-hashtb)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9171
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9172 (defun gnus-mark-xrefs-as-read (from-newsgroup headers unreads)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9173 "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
9174 (let ((virtual (gnus-virtual-group-p from-newsgroup))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9175 name entry info xref-hashtb idlist method nth4)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9176 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9177 (set-buffer gnus-group-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9178 (when (setq xref-hashtb
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9179 (gnus-create-xref-hashtb from-newsgroup headers unreads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9180 (mapatoms
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9181 (lambda (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9182 (unless (string= from-newsgroup (setq name (symbol-name group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9183 (setq idlist (symbol-value group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9184 ;; Dead groups are not updated.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9185 (and (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9186 (setq entry (gnus-gethash name gnus-newsrc-hashtb)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9187 info (nth 2 entry))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9188 (if (stringp (setq nth4 (gnus-info-method info)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9189 (setq nth4 (gnus-server-to-method nth4))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9190 ;; Only do the xrefs if the group has the same
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9191 ;; select method as the group we have just read.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9192 (or (gnus-methods-equal-p
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9193 nth4 (gnus-find-method-for-group from-newsgroup))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9194 virtual
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9195 (equal nth4 (setq method (gnus-find-method-for-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9196 from-newsgroup)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9197 (and (equal (car nth4) (car method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9198 (equal (nth 1 nth4) (nth 1 method))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9199 gnus-use-cross-reference
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9200 (or (not (eq gnus-use-cross-reference t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9201 virtual
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9202 ;; Only do cross-references on subscribed
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9203 ;; groups, if that is what is wanted.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9204 (<= (gnus-info-level info) gnus-level-subscribed))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9205 (gnus-group-make-articles-read name idlist))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9206 xref-hashtb)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9207
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9208 (defun gnus-group-make-articles-read (group articles)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9209 (let* ((num 0)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9210 (entry (gnus-gethash group gnus-newsrc-hashtb))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9211 (info (nth 2 entry))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9212 (active (gnus-active group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9213 range)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9214 ;; First peel off all illegal article numbers.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9215 (if active
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9216 (let ((ids articles)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9217 id first)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9218 (while ids
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9219 (setq id (car ids))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9220 (if (and first (> id (cdr active)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9221 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9222 ;; We'll end up in this situation in one particular
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9223 ;; obscure situation. If you re-scan a group and get
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9224 ;; a new article that is cross-posted to a different
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9225 ;; group that has not been re-scanned, you might get
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9226 ;; crossposted article that has a higher number than
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9227 ;; Gnus believes possible. So we re-activate this
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9228 ;; 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
9229 ;; crossposting thingy will *increase* the number
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9230 ;; of articles in some groups. Tsk, tsk.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9231 (setq active (or (gnus-activate-group group) active))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9232 (if (or (> id (cdr active))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9233 (< id (car active)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9234 (setq articles (delq id articles)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9235 (setq ids (cdr ids)))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9236 ;; If the read list is nil, we init it.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9237 (and active
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9238 (null (gnus-info-read info))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9239 (> (car active) 1)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9240 (gnus-info-set-read info (cons 1 (1- (car active)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9241 ;; Then we add the read articles to the range.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9242 (gnus-info-set-read
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9243 info
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9244 (setq range
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9245 (gnus-add-to-range
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9246 (gnus-info-read info) (setq articles (sort articles '<)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9247 ;; Then we have to re-compute how many unread
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9248 ;; articles there are in this group.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9249 (if active
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9250 (progn
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9251 (cond
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9252 ((not range)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9253 (setq num (- (1+ (cdr active)) (car active))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9254 ((not (listp (cdr range)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9255 (setq num (- (cdr active) (- (1+ (cdr range))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9256 (car range)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9257 (t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9258 (while range
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9259 (if (numberp (car range))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9260 (setq num (1+ num))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9261 (setq num (+ num (- (1+ (cdar range)) (caar range)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9262 (setq range (cdr range)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9263 (setq num (- (cdr active) num))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9264 ;; Update the number of unread articles.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9265 (setcar entry num)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9266 ;; Update the group buffer.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9267 (gnus-group-update-group group t)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9268
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9269 (defun gnus-methods-equal-p (m1 m2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9270 (let ((m1 (or m1 gnus-select-method))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9271 (m2 (or m2 gnus-select-method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9272 (or (equal m1 m2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9273 (and (eq (car m1) (car m2))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9274 (or (not (memq 'address (assoc (symbol-name (car m1))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9275 gnus-valid-select-methods)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9276 (equal (nth 1 m1) (nth 1 m2)))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9277
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9278 (defsubst gnus-header-value ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9279 (buffer-substring (match-end 0) (gnus-point-at-eol)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9280
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9281 (defvar gnus-newsgroup-none-id 0)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9282
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9283 (defun gnus-get-newsgroup-headers (&optional dependencies force-new)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9284 (let ((cur nntp-server-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9285 (dependencies
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9286 (or dependencies
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9287 (save-excursion (set-buffer gnus-summary-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9288 gnus-newsgroup-dependencies)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9289 headers id id-dep ref-dep end ref)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9290 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9291 (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
9292 (run-hooks 'gnus-parse-headers-hook)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9293 (let ((case-fold-search t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9294 in-reply-to header p lines)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9295 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9296 ;; Search to the beginning of the next header. Error messages
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9297 ;; do not begin with 2 or 3.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9298 (while (re-search-forward "^[23][0-9]+ " nil t)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9299 (setq id nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9300 ref nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9301 ;; This implementation of this function, with nine
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9302 ;; search-forwards instead of the one re-search-forward and
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9303 ;; a case (which basically was the old function) is actually
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9304 ;; about twice as fast, even though it looks messier. You
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9305 ;; can't have everything, I guess. Speed and elegance
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9306 ;; doesn't always go hand in hand.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9307 (setq
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9308 header
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9309 (vector
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9310 ;; Number.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9311 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9312 (read cur)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9313 (end-of-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9314 (setq p (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9315 (narrow-to-region (point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9316 (or (and (search-forward "\n.\n" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9317 (- (point) 2))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9318 (point))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9319 ;; Subject.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9320 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9321 (goto-char p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9322 (if (search-forward "\nsubject: " nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9323 (gnus-header-value) "(none)"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9324 ;; From.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9325 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9326 (goto-char p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9327 (if (search-forward "\nfrom: " nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9328 (gnus-header-value) "(nobody)"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9329 ;; Date.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9330 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9331 (goto-char p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9332 (if (search-forward "\ndate: " nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9333 (gnus-header-value) ""))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9334 ;; Message-ID.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9335 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9336 (goto-char p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9337 (if (search-forward "\nmessage-id: " nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9338 (setq id (gnus-header-value))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9339 ;; 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
9340 ;; subsequent routines simpler.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9341 (setq id (concat "none+"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9342 (int-to-string
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9343 (setq gnus-newsgroup-none-id
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9344 (1+ gnus-newsgroup-none-id)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9345 ;; References.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9346 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9347 (goto-char p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9348 (if (search-forward "\nreferences: " nil t)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9349 (progn
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9350 (setq end (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9351 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9352 (gnus-header-value)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9353 (setq ref
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9354 (buffer-substring
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9355 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9356 (end-of-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9357 (search-backward ">" end t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9358 (1+ (point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9359 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9360 (search-backward "<" end t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9361 (point))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9362 ;; Get the references from the in-reply-to header if there
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9363 ;; were no references and the in-reply-to header looks
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9364 ;; promising.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9365 (if (and (search-forward "\nin-reply-to: " nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9366 (setq in-reply-to (gnus-header-value))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9367 (string-match "<[^>]+>" in-reply-to))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9368 (setq ref (substring in-reply-to (match-beginning 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9369 (match-end 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9370 (setq ref ""))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9371 ;; Chars.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9372 0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9373 ;; Lines.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9374 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9375 (goto-char p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9376 (if (search-forward "\nlines: " nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9377 (if (numberp (setq lines (read cur)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9378 lines 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9379 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9380 ;; Xref.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9381 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9382 (goto-char p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9383 (and (search-forward "\nxref: " nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9384 (gnus-header-value)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9385 ;; We do the threading while we read the headers. The
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9386 ;; message-id and the last reference are both entered into
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9387 ;; the same hash table. Some tippy-toeing around has to be
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9388 ;; done in case an article has arrived before the article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9389 ;; which it refers to.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9390 (if (boundp (setq id-dep (intern id dependencies)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9391 (if (and (car (symbol-value id-dep))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9392 (not force-new))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9393 ;; An article with this Message-ID has already
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9394 ;; been seen, so we ignore this one, except we add
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9395 ;; any additional Xrefs (in case the two articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9396 ;; came from different servers).
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9397 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9398 (mail-header-set-xref
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9399 (car (symbol-value id-dep))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9400 (concat (or (mail-header-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 (or (mail-header-xref header) "")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9403 (setq header nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9404 (setcar (symbol-value id-dep) header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9405 (set id-dep (list header)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9406 (when header
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9407 (if (boundp (setq ref-dep (intern ref dependencies)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9408 (setcdr (symbol-value ref-dep)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9409 (nconc (cdr (symbol-value ref-dep))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9410 (list (symbol-value id-dep))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9411 (set ref-dep (list nil (symbol-value id-dep))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9412 (setq headers (cons header headers)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9413 (goto-char (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9414 (widen))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9415 (nreverse headers)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9416
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9417 ;; The following macros and functions were written by Felix Lee
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9418 ;; <flee@cse.psu.edu>.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9419
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9420 (defmacro gnus-nov-read-integer ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9421 '(prog1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9422 (if (= (following-char) ?\t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9423 0
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9424 (let ((num (condition-case nil (read buffer) (error nil))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9425 (if (numberp num) num 0)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9426 (or (eobp) (forward-char 1))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9427
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9428 (defmacro gnus-nov-skip-field ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9429 '(search-forward "\t" eol 'move))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9430
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9431 (defmacro gnus-nov-field ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9432 '(buffer-substring (point) (if (gnus-nov-skip-field) (1- (point)) eol)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9433
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9434 ;; 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
9435 (defun gnus-get-newsgroup-headers-xover (sequence &optional
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9436 force-new dependencies)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9437 "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
9438 list of headers that match SEQUENCE (see `nntp-retrieve-headers')."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9439 ;; 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
9440 ;; NNTP servers do not include Xrefs when using XOVER.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9441 (setq gnus-article-internal-prepare-hook '(gnus-article-get-xrefs))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9442 (let ((cur nntp-server-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9443 (dependencies (or dependencies gnus-newsgroup-dependencies))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9444 number headers header)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9445 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9446 (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
9447 ;; 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
9448 (run-hooks 'gnus-parse-headers-hook)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9449 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9450 (while (and sequence (not (eobp)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9451 (setq number (read cur))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9452 (while (and sequence (< (car sequence) number))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9453 (setq sequence (cdr sequence)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9454 (and sequence
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9455 (eq number (car sequence))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9456 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9457 (setq sequence (cdr sequence))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9458 (if (setq header
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9459 (inline (gnus-nov-parse-line
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9460 number dependencies force-new)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9461 (setq headers (cons header headers)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9462 (forward-line 1))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9463 (setq headers (nreverse headers)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9464 headers))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9465
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9466 ;; 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
9467 ;; on the beginning of the line.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9468 (defun gnus-nov-parse-line (number dependencies &optional force-new)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9469 (let ((none 0)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9470 (eol (gnus-point-at-eol))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9471 (buffer (current-buffer))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9472 header ref id id-dep ref-dep)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9473
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9474 ;; overview: [num subject from date id refs chars lines misc]
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9475 (narrow-to-region (point) eol)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9476 (or (eobp) (forward-char))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9477
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9478 (condition-case nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9479 (setq header
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9480 (vector
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9481 number ; number
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9482 (gnus-nov-field) ; subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9483 (gnus-nov-field) ; from
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9484 (gnus-nov-field) ; date
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9485 (setq id (or (gnus-nov-field)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9486 (concat "none+"
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9487 (int-to-string
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9488 (setq none (1+ none)))))) ; id
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9489 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9490 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9491 (let ((beg (point)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9492 (search-forward "\t" eol)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9493 (if (search-backward ">" beg t)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9494 (setq ref
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9495 (buffer-substring
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9496 (1+ (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9497 (search-backward "<" beg t)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9498 (setq ref nil))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9499 (gnus-nov-field)) ; refs
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9500 (gnus-nov-read-integer) ; chars
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9501 (gnus-nov-read-integer) ; lines
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9502 (if (= (following-char) ?\n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9503 nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9504 (gnus-nov-field)) ; misc
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9505 ))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9506 (error (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9507 (gnus-error 4 "Strange nov line")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9508 (setq header nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9509 (goto-char eol))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9510
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9511 (widen)
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 ;; We build the thread tree.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9514 (when header
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9515 (if (boundp (setq id-dep (intern id dependencies)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9516 (if (and (car (symbol-value id-dep))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9517 (not force-new))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9518 ;; An article with this Message-ID has already been seen,
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9519 ;; so we ignore this one, except we add any additional
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9520 ;; Xrefs (in case the two articles came from different
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9521 ;; servers.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9522 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9523 (mail-header-set-xref
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9524 (car (symbol-value id-dep))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9525 (concat (or (mail-header-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 (or (mail-header-xref header) "")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9528 (setq header nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9529 (setcar (symbol-value id-dep) header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9530 (set id-dep (list header))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9531 (when header
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9532 (if (boundp (setq ref-dep (intern (or ref "none") dependencies)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9533 (setcdr (symbol-value ref-dep)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9534 (nconc (cdr (symbol-value ref-dep))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9535 (list (symbol-value id-dep))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9536 (set ref-dep (list nil (symbol-value id-dep)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9537 header))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9538
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9539 (defun gnus-article-get-xrefs ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9540 "Fill in the Xref value in `gnus-current-headers', if necessary.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9541 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
9542 (let ((headers (save-excursion (set-buffer gnus-summary-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9543 gnus-current-headers)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9544 (or (not gnus-use-cross-reference)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9545 (not headers)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9546 (and (mail-header-xref headers)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9547 (not (string= (mail-header-xref headers) "")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9548 (let ((case-fold-search t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9549 xref)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9550 (save-restriction
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9551 (nnheader-narrow-to-headers)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9552 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9553 (if (or (and (eq (downcase (following-char)) ?x)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9554 (looking-at "Xref:"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9555 (search-forward "\nXref:" nil t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9556 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9557 (goto-char (1+ (match-end 0)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9558 (setq xref (buffer-substring (point)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9559 (progn (end-of-line) (point))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9560 (mail-header-set-xref headers xref))))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9561
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9562 (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
9563 "Find article ID and insert the summary line for that article."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9564 (let ((header (if (and old-header use-old-header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9565 old-header (gnus-read-header id)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9566 (number (and (numberp id) id))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9567 pos)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9568 (when header
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9569 ;; 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
9570 ;; article we have fetched.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9571 (when (and (not gnus-show-threads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9572 old-header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9573 (when (setq pos (text-property-any
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9574 (point-min) (point-max) 'gnus-number
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9575 (mail-header-number old-header)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9576 (goto-char pos)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9577 (gnus-delete-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9578 (gnus-data-remove (mail-header-number old-header))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9579 (when old-header
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9580 (mail-header-set-number header (mail-header-number old-header)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9581 (setq gnus-newsgroup-sparse
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9582 (delq (setq number (mail-header-number header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9583 gnus-newsgroup-sparse))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9584 (setq gnus-newsgroup-ancient (delq number gnus-newsgroup-ancient))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9585 (gnus-rebuild-thread (mail-header-id header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9586 (gnus-summary-goto-subject number nil t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9587 (when (and (numberp number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9588 (> number 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9589 ;; 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
9590 ;; 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
9591 ;; command will fetch the previous (or next) article even
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9592 ;; 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
9593 (and (> number gnus-newsgroup-end)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9594 (setq gnus-newsgroup-end number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9595 (and (< number gnus-newsgroup-begin)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9596 (setq gnus-newsgroup-begin number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9597 (setq gnus-newsgroup-unselected
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9598 (delq number gnus-newsgroup-unselected)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9599 ;; Report back a success?
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9600 (and header (mail-header-number header))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9601
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9602 (defun gnus-summary-work-articles (n)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9603 "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
9604 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
9605 taken into consideration."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9606 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9607 (n
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9608 ;; A numerical prefix has been given.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9609 (let ((backward (< n 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9610 (n (abs (prefix-numeric-value n)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9611 articles article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9612 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9613 (while
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9614 (and (> n 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9615 (push (setq article (gnus-summary-article-number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9616 articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9617 (if backward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9618 (gnus-summary-find-prev nil article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9619 (gnus-summary-find-next nil article)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9620 (decf n)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9621 (nreverse articles)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9622 ((and (boundp 'transient-mark-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9623 transient-mark-mode
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9624 mark-active)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9625 ;; Work on the region between point and mark.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9626 (let ((max (max (point) (mark)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9627 articles article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9628 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9629 (goto-char (min (point) (mark)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9630 (while
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9631 (and
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9632 (push (setq article (gnus-summary-article-number)) articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9633 (gnus-summary-find-next nil article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9634 (< (point) max)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9635 (nreverse articles))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9636 (gnus-newsgroup-processable
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9637 ;; There are process-marked articles present.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9638 (reverse gnus-newsgroup-processable))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9639 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9640 ;; Just return the current article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9641 (list (gnus-summary-article-number)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9642
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9643 (defun gnus-summary-search-group (&optional backward use-level)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9644 "Search for next unread newsgroup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9645 If optional argument BACKWARD is non-nil, search backward instead."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9646 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9647 (set-buffer gnus-group-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9648 (if (gnus-group-search-forward
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9649 backward nil (if use-level (gnus-group-group-level) nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9650 (gnus-group-group-name))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9651
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9652 (defun gnus-summary-best-group (&optional exclude-group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9653 "Find the name of the best unread group.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9654 If EXCLUDE-GROUP, do not go to this group."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9655 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9656 (set-buffer gnus-group-buffer)
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 (gnus-group-best-unread-group exclude-group))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9659
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9660 (defun gnus-summary-find-next (&optional unread article backward)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9661 (if backward (gnus-summary-find-prev)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9662 (let* ((dummy (gnus-summary-article-intangible-p))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9663 (article (or article (gnus-summary-article-number)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9664 (arts (gnus-data-find-list article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9665 result)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9666 (when (and (not dummy)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9667 (or (not gnus-summary-check-current)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9668 (not unread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9669 (not (gnus-data-unread-p (car arts)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9670 (setq arts (cdr arts)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9671 (when (setq result
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9672 (if unread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9673 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9674 (while arts
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9675 (when (gnus-data-unread-p (car arts))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9676 (setq result (car arts)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9677 arts nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9678 (setq arts (cdr arts)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9679 result)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9680 (car arts)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9681 (goto-char (gnus-data-pos result))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9682 (gnus-data-number result)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9683
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9684 (defun gnus-summary-find-prev (&optional unread article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9685 (let* ((eobp (eobp))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9686 (article (or article (gnus-summary-article-number)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9687 (arts (gnus-data-find-list article (gnus-data-list 'rev)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9688 result)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9689 (when (and (not eobp)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9690 (or (not gnus-summary-check-current)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9691 (not unread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9692 (not (gnus-data-unread-p (car arts)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9693 (setq arts (cdr arts)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9694 (if (setq result
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9695 (if unread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9696 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9697 (while arts
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9698 (and (gnus-data-unread-p (car arts))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9699 (setq result (car arts)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9700 arts nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9701 (setq arts (cdr arts)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9702 result)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9703 (car arts)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9704 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9705 (goto-char (gnus-data-pos result))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9706 (gnus-data-number result)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9707
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9708 (defun gnus-summary-find-subject (subject &optional unread backward article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9709 (let* ((simp-subject (gnus-simplify-subject-fully subject))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9710 (article (or article (gnus-summary-article-number)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9711 (articles (gnus-data-list backward))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9712 (arts (gnus-data-find-list article articles))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9713 result)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9714 (when (or (not gnus-summary-check-current)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9715 (not unread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9716 (not (gnus-data-unread-p (car arts))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9717 (setq arts (cdr arts)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9718 (while arts
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9719 (and (or (not unread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9720 (gnus-data-unread-p (car arts)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9721 (vectorp (gnus-data-header (car arts)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9722 (gnus-subject-equal
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9723 simp-subject (mail-header-subject (gnus-data-header (car arts))) t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9724 (setq result (car arts)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9725 arts nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9726 (setq arts (cdr arts)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9727 (and result
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9728 (goto-char (gnus-data-pos result))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9729 (gnus-data-number result))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9730
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9731 (defun gnus-summary-search-forward (&optional unread subject backward)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9732 "Search forward for an article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9733 If UNREAD, look for unread articles. If SUBJECT, look for
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9734 articles with that subject. If BACKWARD, search backward instead."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9735 (cond (subject (gnus-summary-find-subject subject unread backward))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9736 (backward (gnus-summary-find-prev unread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9737 (t (gnus-summary-find-next unread))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9738
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9739 (defun gnus-recenter (&optional n)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9740 "Center point in window and redisplay frame.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9741 Also do horizontal recentering."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9742 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9743 (when (and gnus-auto-center-summary
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9744 (not (eq gnus-auto-center-summary 'vertical)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9745 (gnus-horizontal-recenter))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9746 (recenter n))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9747
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9748 (defun gnus-summary-recenter ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9749 "Center point in the summary window.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9750 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
9751 displayed, no centering will be performed."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9752 ;; Suggested by earle@mahendo.JPL.NASA.GOV (Greg Earle).
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9753 ;; 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
9754 (let* ((top (cond ((< (window-height) 4) 0)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9755 ((< (window-height) 7) 1)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9756 (t 2)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9757 (height (1- (window-height)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9758 (bottom (save-excursion (goto-char (point-max))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9759 (forward-line (- height))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9760 (point)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9761 (window (get-buffer-window (current-buffer))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9762 ;; The user has to want it.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9763 (when gnus-auto-center-summary
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9764 (when (get-buffer-window gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9765 ;; Only do recentering when the article buffer is displayed,
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9766 ;; Set the window start to either `bottom', which is the biggest
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9767 ;; possible valid number, or the second line from the top,
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9768 ;; whichever is the least.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9769 (set-window-start
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9770 window (min bottom (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9771 (forward-line (- top)) (point)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9772 ;; Do horizontal recentering while we're at it.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9773 (when (and (get-buffer-window (current-buffer) t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9774 (not (eq gnus-auto-center-summary 'vertical)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9775 (let ((selected (selected-window)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9776 (select-window (get-buffer-window (current-buffer) t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9777 (gnus-summary-position-point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9778 (gnus-horizontal-recenter)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9779 (select-window selected))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9780
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9781 (defun gnus-horizontal-recenter ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9782 "Recenter the current buffer horizontally."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9783 (if (< (current-column) (/ (window-width) 2))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9784 (set-window-hscroll (get-buffer-window (current-buffer) t) 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9785 (let* ((orig (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9786 (end (window-end (get-buffer-window (current-buffer) t)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9787 (max 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9788 ;; Find the longest line currently displayed in the window.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9789 (goto-char (window-start))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9790 (while (and (not (eobp))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9791 (< (point) end))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9792 (end-of-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9793 (setq max (max max (current-column)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9794 (forward-line 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9795 (goto-char orig)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9796 ;; Scroll horizontally to center (sort of) the point.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9797 (if (> max (window-width))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9798 (set-window-hscroll
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9799 (get-buffer-window (current-buffer) t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9800 (min (- (current-column) (/ (window-width) 3))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9801 (+ 2 (- max (window-width)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9802 (set-window-hscroll (get-buffer-window (current-buffer) t) 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9803 max)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9804
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9805 ;; Function written by Stainless Steel Rat <ratinox@ccs.neu.edu>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9806 (defun gnus-short-group-name (group &optional levels)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9807 "Collapse GROUP name LEVELS."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9808 (let* ((name "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9809 (foreign "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9810 (depth 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9811 (skip 1)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9812 (levels (or levels
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9813 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9814 (while (string-match "\\." group skip)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9815 (setq skip (match-end 0)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9816 depth (+ depth 1)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9817 depth))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9818 (if (string-match ":" group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9819 (setq foreign (substring group 0 (match-end 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9820 group (substring group (match-end 0))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9821 (while group
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9822 (if (and (string-match "\\." group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9823 (> levels (- gnus-group-uncollapsed-levels 1)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9824 (setq name (concat name (substring group 0 1))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9825 group (substring group (match-end 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9826 levels (- levels 1)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9827 name (concat name "."))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9828 (setq name (concat foreign name group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9829 group nil)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9830 name))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9831
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9832 (defun gnus-summary-jump-to-group (newsgroup)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9833 "Move point to NEWSGROUP in group mode buffer."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9834 ;; Keep update point of group mode buffer if visible.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9835 (if (eq (current-buffer) (get-buffer gnus-group-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9836 (save-window-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9837 ;; Take care of tree window mode.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9838 (if (get-buffer-window gnus-group-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9839 (pop-to-buffer gnus-group-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9840 (gnus-group-jump-to-group newsgroup))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9841 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9842 ;; Take care of tree window mode.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9843 (if (get-buffer-window gnus-group-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9844 (pop-to-buffer gnus-group-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9845 (set-buffer gnus-group-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9846 (gnus-group-jump-to-group newsgroup))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9847
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9848 ;; This function returns a list of article numbers based on the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9849 ;; difference between the ranges of read articles in this group and
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9850 ;; the range of active articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9851 (defun gnus-list-of-unread-articles (group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9852 (let* ((read (gnus-info-read (gnus-get-info group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9853 (active (gnus-active group))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9854 (last (cdr active))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9855 first nlast unread)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9856 ;; If none are read, then all are unread.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9857 (if (not read)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9858 (setq first (car active))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9859 ;; 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
9860 ;; first unread article is the article after the last read
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9861 ;; article. Sounds logical, doesn't it?
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9862 (if (not (listp (cdr read)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9863 (setq first (1+ (cdr read)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9864 ;; `read' is a list of ranges.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9865 (if (/= (setq nlast (or (and (numberp (car read)) (car read))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9866 (caar read))) 1)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9867 (setq first 1))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9868 (while read
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9869 (if first
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9870 (while (< first nlast)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9871 (setq unread (cons first unread))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9872 (setq first (1+ first))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9873 (setq first (1+ (if (atom (car read)) (car read) (cdar read))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9874 (setq nlast (if (atom (cadr read)) (cadr read) (caadr read)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9875 (setq read (cdr read)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9876 ;; And add the last unread articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9877 (while (<= first last)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9878 (setq unread (cons first unread))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9879 (setq first (1+ first)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9880 ;; Return the list of unread articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9881 (nreverse unread)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9882
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9883 (defun gnus-list-of-read-articles (group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9884 "Return a list of unread, unticked and non-dormant articles."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9885 (let* ((info (gnus-get-info group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9886 (marked (gnus-info-marks info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9887 (active (gnus-active group)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9888 (and info active
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9889 (gnus-set-difference
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9890 (gnus-sorted-complement
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9891 (gnus-uncompress-range active)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9892 (gnus-list-of-unread-articles group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9893 (append
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9894 (gnus-uncompress-range (cdr (assq 'dormant marked)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9895 (gnus-uncompress-range (cdr (assq 'tick marked))))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9896
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9897 ;; Various summary commands
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9898
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9899 (defun gnus-summary-universal-argument (arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9900 "Perform any operation on all articles that are process/prefixed."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9901 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9902 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9903 (let ((articles (gnus-summary-work-articles arg))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9904 func article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9905 (if (eq
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9906 (setq
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9907 func
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9908 (key-binding
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9909 (read-key-sequence
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9910 (substitute-command-keys
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9911 "\\<gnus-summary-mode-map>\\[gnus-summary-universal-argument]"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9912 ))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9913 'undefined)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9914 (gnus-error 1 "Undefined key")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9915 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9916 (while articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9917 (gnus-summary-goto-subject (setq article (pop articles)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9918 (command-execute func)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9919 (gnus-summary-remove-process-mark article)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9920 (gnus-summary-position-point))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9921
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9922 (defun gnus-summary-toggle-truncation (&optional arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9923 "Toggle truncation of summary lines.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9924 With arg, turn line truncation on iff arg is positive."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9925 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9926 (setq truncate-lines
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9927 (if (null arg) (not truncate-lines)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9928 (> (prefix-numeric-value arg) 0)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9929 (redraw-display))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9930
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9931 (defun gnus-summary-reselect-current-group (&optional all rescan)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9932 "Exit and then reselect the current newsgroup.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9933 The prefix argument ALL means to select all articles."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9934 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9935 (gnus-set-global-variables)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9936 (when (gnus-ephemeral-group-p gnus-newsgroup-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9937 (error "Ephemeral groups can't be reselected"))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9938 (let ((current-subject (gnus-summary-article-number))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9939 (group gnus-newsgroup-name))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9940 (setq gnus-newsgroup-begin nil)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9941 (gnus-summary-exit)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9942 ;; 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
9943 ;; current point was moved to the next unread newsgroup by
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9944 ;; exiting.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9945 (gnus-summary-jump-to-group group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9946 (when rescan
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9947 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9948 (gnus-group-get-new-news-this-group 1)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9949 (gnus-group-read-group all t)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9950 (gnus-summary-goto-subject current-subject nil t)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9951
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9952 (defun gnus-summary-rescan-group (&optional all)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9953 "Exit the newsgroup, ask for new articles, and select the newsgroup."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9954 (interactive "P")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9955 (gnus-summary-reselect-current-group all t))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9956
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9957 (defun gnus-summary-update-info ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9958 (let* ((group gnus-newsgroup-name))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9959 (when gnus-newsgroup-kill-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9960 (setq gnus-newsgroup-killed
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9961 (gnus-compress-sequence
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9962 (nconc
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9963 (gnus-set-sorted-intersection
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9964 (gnus-uncompress-range gnus-newsgroup-killed)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9965 (setq gnus-newsgroup-unselected
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9966 (sort gnus-newsgroup-unselected '<)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9967 (setq gnus-newsgroup-unreads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9968 (sort gnus-newsgroup-unreads '<))) t)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9969 (unless (listp (cdr gnus-newsgroup-killed))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9970 (setq gnus-newsgroup-killed (list gnus-newsgroup-killed)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9971 (let ((headers gnus-newsgroup-headers))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9972 (run-hooks 'gnus-exit-group-hook)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9973 (unless gnus-save-score
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9974 (setq gnus-newsgroup-scored nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9975 ;; Set the new ranges of read articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9976 (gnus-update-read-articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9977 group (append gnus-newsgroup-unreads gnus-newsgroup-unselected))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9978 ;; Set the current article marks.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9979 (gnus-update-marks)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9980 ;; Do the cross-ref thing.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9981 (when gnus-use-cross-reference
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9982 (gnus-mark-xrefs-as-read group headers gnus-newsgroup-unreads))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9983 ;; Do adaptive scoring, and possibly save score files.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9984 (when gnus-newsgroup-adaptive
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9985 (gnus-score-adaptive))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9986 (when gnus-use-scoring
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9987 (gnus-score-save))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9988 ;; Do not switch windows but change the buffer to work.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9989 (set-buffer gnus-group-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9990 (or (gnus-ephemeral-group-p gnus-newsgroup-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9991 (gnus-group-update-group group)))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9992
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9993 (defun gnus-summary-exit (&optional temporary)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9994 "Exit reading current newsgroup, and then return to group selection mode.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9995 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
9996 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9997 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9998 (gnus-kill-save-kill-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9999 (let* ((group gnus-newsgroup-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10000 (quit-config (gnus-group-quit-config gnus-newsgroup-name))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10001 (mode major-mode)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10002 (buf (current-buffer)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10003 (run-hooks 'gnus-summary-prepare-exit-hook)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10004 ;; If we have several article buffers, we kill them at exit.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10005 (unless gnus-single-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10006 (gnus-kill-buffer gnus-original-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10007 (setq gnus-article-current nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10008 (when gnus-use-cache
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10009 (gnus-cache-possibly-remove-articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10010 (gnus-cache-save-buffers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10011 (when gnus-use-trees
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10012 (gnus-tree-close group))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10013 ;; Make all changes in this group permanent.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10014 (unless quit-config
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10015 (gnus-summary-update-info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10016 (gnus-close-group group)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10017 ;; Make sure where I was, and go to next newsgroup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10018 (set-buffer gnus-group-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10019 (unless quit-config
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10020 (gnus-group-jump-to-group group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10021 (run-hooks 'gnus-summary-exit-hook)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10022 (unless quit-config
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10023 (gnus-group-next-unread-group 1))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10024 (if temporary
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10025 nil ;Nothing to do.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10026 ;; If we have several article buffers, we kill them at exit.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10027 (unless gnus-single-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10028 (gnus-kill-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10029 (gnus-kill-buffer gnus-original-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10030 (setq gnus-article-current nil))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10031 (set-buffer buf)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10032 (if (not gnus-kill-summary-on-exit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10033 (gnus-deaden-summary)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10034 ;; 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
10035 ;; 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
10036 ;; not garbage-collected, it seems. This would the lead to en
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10037 ;; ever-growing Emacs.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10038 (gnus-summary-clear-local-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10039 (when (get-buffer gnus-article-buffer)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10040 (bury-buffer gnus-article-buffer))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10041 ;; We clear the global counterparts of the buffer-local
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10042 ;; variables as well, just to be on the safe side.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10043 (gnus-configure-windows 'group 'force)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10044 (gnus-summary-clear-local-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10045 ;; Return to group mode buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10046 (if (eq mode 'gnus-summary-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10047 (gnus-kill-buffer buf)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10048 (setq gnus-current-select-method gnus-select-method)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10049 (pop-to-buffer gnus-group-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10050 ;; Clear the current group name.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10051 (if (not quit-config)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10052 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10053 (gnus-group-jump-to-group group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10054 (gnus-group-next-unread-group 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10055 (gnus-configure-windows 'group 'force))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10056 (if (not (buffer-name (car quit-config)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10057 (gnus-configure-windows 'group 'force)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10058 (set-buffer (car quit-config))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10059 (and (eq major-mode 'gnus-summary-mode)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10060 (gnus-set-global-variables))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10061 (gnus-configure-windows (cdr quit-config))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10062 (unless quit-config
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10063 (setq gnus-newsgroup-name nil)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10064
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10065 (defalias 'gnus-summary-quit 'gnus-summary-exit-no-update)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10066 (defun gnus-summary-exit-no-update (&optional no-questions)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10067 "Quit reading current newsgroup without updating read article info."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10068 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10069 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10070 (let* ((group gnus-newsgroup-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10071 (quit-config (gnus-group-quit-config group)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10072 (when (or no-questions
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10073 gnus-expert-user
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10074 (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
10075 ;; If we have several article buffers, we kill them at exit.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10076 (unless gnus-single-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10077 (gnus-kill-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10078 (gnus-kill-buffer gnus-original-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10079 (setq gnus-article-current nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10080 (if (not gnus-kill-summary-on-exit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10081 (gnus-deaden-summary)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10082 (gnus-close-group group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10083 (gnus-summary-clear-local-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10084 (set-buffer gnus-group-buffer)
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 (when (get-buffer gnus-summary-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10087 (kill-buffer gnus-summary-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10088 (unless gnus-single-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10089 (setq gnus-article-current nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10090 (when gnus-use-trees
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10091 (gnus-tree-close group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10092 (when (get-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10093 (bury-buffer gnus-article-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10094 ;; Return to the group buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10095 (gnus-configure-windows 'group 'force)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10096 ;; Clear the current group name.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10097 (setq gnus-newsgroup-name nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10098 (when (equal (gnus-group-group-name) group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10099 (gnus-group-next-unread-group 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10100 (when quit-config
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10101 (if (not (buffer-name (car quit-config)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10102 (gnus-configure-windows 'group 'force)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10103 (set-buffer (car quit-config))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10104 (when (eq major-mode 'gnus-summary-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10105 (gnus-set-global-variables))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10106 (gnus-configure-windows (cdr quit-config)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10107
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10108 ;;; Dead summaries.
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 (defvar gnus-dead-summary-mode-map nil)
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 (if gnus-dead-summary-mode-map
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10113 nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10114 (setq gnus-dead-summary-mode-map (make-keymap))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10115 (suppress-keymap gnus-dead-summary-mode-map)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10116 (substitute-key-definition
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10117 '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
10118 (let ((keys '("\C-d" "\r" "\177")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10119 (while keys
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10120 (define-key gnus-dead-summary-mode-map
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10121 (pop keys) 'gnus-summary-wake-up-the-dead))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10122
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10123 (defvar gnus-dead-summary-mode nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10124 "Minor mode for Gnus summary buffers.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10125
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10126 (defun gnus-dead-summary-mode (&optional arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10127 "Minor mode for Gnus summary buffers."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10128 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10129 (when (eq major-mode 'gnus-summary-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10130 (make-local-variable 'gnus-dead-summary-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10131 (setq gnus-dead-summary-mode
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10132 (if (null arg) (not gnus-dead-summary-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10133 (> (prefix-numeric-value arg) 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10134 (when gnus-dead-summary-mode
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10135 (unless (assq 'gnus-dead-summary-mode minor-mode-alist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10136 (push '(gnus-dead-summary-mode " Dead") minor-mode-alist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10137 (unless (assq 'gnus-dead-summary-mode minor-mode-map-alist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10138 (push (cons 'gnus-dead-summary-mode gnus-dead-summary-mode-map)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10139 minor-mode-map-alist)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10140
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10141 (defun gnus-deaden-summary ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10142 "Make the current summary buffer into a dead summary buffer."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10143 ;; Kill any previous dead summary buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10144 (when (and gnus-dead-summary
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10145 (buffer-name gnus-dead-summary))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10146 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10147 (set-buffer gnus-dead-summary)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10148 (when gnus-dead-summary-mode
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10149 (kill-buffer (current-buffer)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10150 ;; Make this the current dead summary.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10151 (setq gnus-dead-summary (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10152 (gnus-dead-summary-mode 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10153 (let ((name (buffer-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10154 (when (string-match "Summary" name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10155 (rename-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10156 (concat (substring name 0 (match-beginning 0)) "Dead "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10157 (substring name (match-beginning 0))) t))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10158
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10159 (defun gnus-kill-or-deaden-summary (buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10160 "Kill or deaden the summary BUFFER."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10161 (when (and (buffer-name buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10162 (not gnus-single-article-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10163 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10164 (set-buffer buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10165 (gnus-kill-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10166 (gnus-kill-buffer gnus-original-article-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10167 (cond (gnus-kill-summary-on-exit
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10168 (when (and gnus-use-trees
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10169 (and (get-buffer buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10170 (buffer-name (get-buffer buffer))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10171 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10172 (set-buffer (get-buffer buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10173 (gnus-tree-close gnus-newsgroup-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10174 (gnus-kill-buffer buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10175 ((and (get-buffer buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10176 (buffer-name (get-buffer buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10177 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10178 (set-buffer buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10179 (gnus-deaden-summary)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10180
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10181 (defun gnus-summary-wake-up-the-dead (&rest args)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10182 "Wake up the dead summary buffer."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10183 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10184 (gnus-dead-summary-mode -1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10185 (let ((name (buffer-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10186 (when (string-match "Dead " name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10187 (rename-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10188 (concat (substring name 0 (match-beginning 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10189 (substring name (match-end 0))) t)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10190 (gnus-message 3 "This dead summary is now alive again"))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10191
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10192 ;; Suggested by Andrew Eskilsson <pi92ae@pt.hk-r.se>.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10193 (defun gnus-summary-fetch-faq (&optional faq-dir)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10194 "Fetch the FAQ for the current group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10195 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
10196 in."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10197 (interactive
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10198 (list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10199 (if current-prefix-arg
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10200 (completing-read
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10201 "Faq dir: " (and (listp gnus-group-faq-directory)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10202 gnus-group-faq-directory)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10203 (let (gnus-faq-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10204 (and (setq gnus-faq-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10205 (gnus-group-fetch-faq gnus-newsgroup-name faq-dir))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10206 (gnus-configure-windows 'summary-faq))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10207
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10208 ;; Suggested by Per Abrahamsen <amanda@iesd.auc.dk>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10209 (defun gnus-summary-describe-group (&optional force)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10210 "Describe the current newsgroup."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10211 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10212 (gnus-group-describe-group force gnus-newsgroup-name))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10213
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10214 (defun gnus-summary-describe-briefly ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10215 "Describe summary mode commands briefly."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10216 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10217 (gnus-message 6
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10218 (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
10219
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10220 ;; Walking around group mode buffer from summary mode.
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 (defun gnus-summary-next-group (&optional no-article target-group backward)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10223 "Exit current newsgroup and then select next unread newsgroup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10224 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
10225 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
10226 previous group instead."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10227 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10228 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10229 (let ((current-group gnus-newsgroup-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10230 (current-buffer (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10231 entered)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10232 ;; 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
10233 ;; 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
10234 ;; 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
10235 ;; want the window conf to change before that...
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10236 (gnus-summary-exit t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10237 (while (not entered)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10238 ;; Then we find what group we are supposed to enter.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10239 (set-buffer gnus-group-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10240 (gnus-group-jump-to-group current-group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10241 (setq target-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10242 (or target-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10243 (if (eq gnus-keep-same-level 'best)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10244 (gnus-summary-best-group gnus-newsgroup-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10245 (gnus-summary-search-group backward gnus-keep-same-level))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10246 (if (not target-group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10247 ;; There are no further groups, so we return to the group
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10248 ;; buffer.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10249 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10250 (gnus-message 5 "Returning to the group buffer")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10251 (setq entered t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10252 (set-buffer current-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10253 (gnus-summary-exit))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10254 ;; We try to enter the target group.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10255 (gnus-group-jump-to-group target-group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10256 (let ((unreads (gnus-group-group-unread)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10257 (if (and (or (eq t unreads)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10258 (and unreads (not (zerop unreads))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10259 (gnus-summary-read-group
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10260 target-group nil no-article current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10261 (setq entered t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10262 (setq current-group target-group
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10263 target-group nil)))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10264
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10265 (defun gnus-summary-prev-group (&optional no-article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10266 "Exit current newsgroup and then select previous unread newsgroup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10267 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
10268 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10269 (gnus-summary-next-group no-article nil t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10270
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10271 ;; Walking around summary lines.
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 (defun gnus-summary-first-subject (&optional unread)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10274 "Go to the first unread subject.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10275 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
10276 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
10277 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10278 (prog1
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10279 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10280 ;; Empty summary.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10281 ((null gnus-newsgroup-data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10282 (gnus-message 3 "No articles in the group")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10283 nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10284 ;; Pick the first article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10285 ((not unread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10286 (goto-char (gnus-data-pos (car gnus-newsgroup-data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10287 (gnus-data-number (car gnus-newsgroup-data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10288 ;; No unread articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10289 ((null gnus-newsgroup-unreads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10290 (gnus-message 3 "No more unread articles")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10291 nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10292 ;; Find the first unread article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10293 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10294 (let ((data gnus-newsgroup-data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10295 (while (and data
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10296 (not (gnus-data-unread-p (car data))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10297 (setq data (cdr data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10298 (if data
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10299 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10300 (goto-char (gnus-data-pos (car data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10301 (gnus-data-number (car data)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10302 (gnus-summary-position-point)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10303
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10304 (defun gnus-summary-next-subject (n &optional unread dont-display)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10305 "Go to next N'th summary line.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10306 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
10307 If UNREAD is non-nil, only unread articles are selected.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10308 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
10309 returned."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10310 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10311 (let ((backward (< n 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10312 (n (abs n)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10313 (while (and (> n 0)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10314 (if backward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10315 (gnus-summary-find-prev unread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10316 (gnus-summary-find-next unread)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10317 (setq n (1- n)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10318 (if (/= 0 n) (gnus-message 7 "No more%s articles"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10319 (if unread " unread" "")))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10320 (unless dont-display
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10321 (gnus-summary-recenter)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10322 (gnus-summary-position-point))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10323 n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10324
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10325 (defun gnus-summary-next-unread-subject (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10326 "Go to next N'th unread summary line."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10327 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10328 (gnus-summary-next-subject n t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10329
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10330 (defun gnus-summary-prev-subject (n &optional unread)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10331 "Go to previous N'th summary line.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10332 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
10333 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10334 (gnus-summary-next-subject (- n) unread))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10335
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10336 (defun gnus-summary-prev-unread-subject (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10337 "Go to previous N'th unread summary line."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10338 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10339 (gnus-summary-next-subject (- n) t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10340
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10341 (defun gnus-summary-goto-subject (article &optional force silent)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10342 "Go the subject line of ARTICLE.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10343 If FORCE, also allow jumping to articles not currently shown."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10344 (let ((b (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10345 (data (gnus-data-find article)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10346 ;; We read in the article if we have to.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10347 (and (not data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10348 force
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10349 (gnus-summary-insert-subject article (and (vectorp force) force) t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10350 (setq data (gnus-data-find article)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10351 (goto-char b)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10352 (if (not data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10353 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10354 (unless silent
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10355 (gnus-message 3 "Can't find article %d" article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10356 nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10357 (goto-char (gnus-data-pos data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10358 article)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10359
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10360 ;; Walking around summary lines with displaying articles.
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 (defun gnus-summary-expand-window (&optional arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10363 "Make the summary buffer take up the entire Emacs frame.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10364 Given a prefix, will force an `article' buffer configuration."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10365 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10366 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10367 (if arg
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10368 (gnus-configure-windows 'article 'force)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10369 (gnus-configure-windows 'summary 'force)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10370
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10371 (defun gnus-summary-display-article (article &optional all-header)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10372 "Display ARTICLE in article buffer."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10373 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10374 (if (null article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10375 nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10376 (prog1
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10377 (if gnus-summary-display-article-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10378 (funcall gnus-summary-display-article-function article all-header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10379 (gnus-article-prepare article all-header))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10380 (run-hooks 'gnus-select-article-hook)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10381 (unless (zerop gnus-current-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10382 (gnus-summary-goto-subject gnus-current-article))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10383 (gnus-summary-recenter)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10384 (when gnus-use-trees
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10385 (gnus-possibly-generate-tree article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10386 (gnus-highlight-selected-tree article))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10387 ;; Successfully display article.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10388 (gnus-article-set-window-start
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10389 (cdr (assq article gnus-newsgroup-bookmarks))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10390
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10391 (defun gnus-summary-select-article (&optional all-headers force pseudo article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10392 "Select the current article.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10393 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
10394 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
10395 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
10396 be displayed."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10397 ;; 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
10398 (unless (eq major-mode 'gnus-summary-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10399 (set-buffer gnus-summary-buffer))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10400 (let ((article (or article (gnus-summary-article-number)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10401 (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
10402 gnus-summary-display-article-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10403 did)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10404 (and (not pseudo)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10405 (gnus-summary-article-pseudo-p article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10406 (error "This is a pseudo-article."))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10407 (prog1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10408 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10409 (set-buffer gnus-summary-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10410 (if (or (and gnus-single-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10411 (or (null gnus-current-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10412 (null gnus-article-current)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10413 (null (get-buffer gnus-article-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10414 (not (eq article (cdr gnus-article-current)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10415 (not (equal (car gnus-article-current)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10416 gnus-newsgroup-name))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10417 (and (not gnus-single-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10418 (or (null gnus-current-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10419 (not (eq gnus-current-article article))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10420 force)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10421 ;; The requested article is different from the current article.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10422 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10423 (gnus-summary-display-article article all-headers)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10424 (setq did article))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10425 (if (or all-headers gnus-show-all-headers)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10426 (gnus-article-show-all-headers))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10427 'old))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10428 (if did
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10429 (gnus-article-set-window-start
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10430 (cdr (assq article gnus-newsgroup-bookmarks)))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10431
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10432 (defun gnus-summary-set-current-mark (&optional current-mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10433 "Obsolete function."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10434 nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10435
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10436 (defun gnus-summary-next-article (&optional unread subject backward push)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10437 "Select the next article.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10438 If UNREAD, only unread articles are selected.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10439 If SUBJECT, only articles with SUBJECT are selected.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10440 If BACKWARD, the previous article is selected instead of the next."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10441 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10442 (gnus-set-global-variables)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10443 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10444 ;; Is there such an article?
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10445 ((and (gnus-summary-search-forward unread subject backward)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10446 (or (gnus-summary-display-article (gnus-summary-article-number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10447 (eq (gnus-summary-article-mark) gnus-canceled-mark)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10448 (gnus-summary-position-point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10449 ;; If not, we try the first unread, if that is wanted.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10450 ((and subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10451 gnus-auto-select-same
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
10452 (gnus-summary-first-unread-article))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10453 (gnus-summary-position-point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10454 (gnus-message 6 "Wrapped"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10455 ;; Try to get next/previous article not displayed in this group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10456 ((and gnus-auto-extend-newsgroup
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10457 (not unread) (not subject))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10458 (gnus-summary-goto-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10459 (if backward (1- gnus-newsgroup-begin) (1+ gnus-newsgroup-end))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10460 nil t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10461 ;; Go to next/previous group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10462 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10463 (or (gnus-ephemeral-group-p gnus-newsgroup-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10464 (gnus-summary-jump-to-group gnus-newsgroup-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10465 (let ((cmd last-command-char)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10466 (group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10467 (if (eq gnus-keep-same-level 'best)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10468 (gnus-summary-best-group gnus-newsgroup-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10469 (gnus-summary-search-group backward gnus-keep-same-level))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10470 ;; For some reason, the group window gets selected. We change
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10471 ;; it back.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10472 (select-window (get-buffer-window (current-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10473 ;; Select next unread newsgroup automagically.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10474 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10475 ((or (not gnus-auto-select-next)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10476 (not cmd))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10477 (gnus-message 7 "No more%s articles" (if unread " unread" "")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10478 ((or (eq gnus-auto-select-next 'quietly)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10479 (and (eq gnus-auto-select-next 'slightly-quietly)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10480 push)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10481 (and (eq gnus-auto-select-next 'almost-quietly)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10482 (gnus-summary-last-article-p)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10483 ;; Select quietly.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10484 (if (gnus-ephemeral-group-p gnus-newsgroup-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10485 (gnus-summary-exit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10486 (gnus-message 7 "No more%s articles (%s)..."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10487 (if unread " unread" "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10488 (if group (concat "selecting " group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10489 "exiting"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10490 (gnus-summary-next-group nil group backward)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10491 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10492 (gnus-summary-walk-group-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10493 gnus-newsgroup-name cmd unread backward)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10494
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10495 (defun gnus-summary-walk-group-buffer (from-group cmd unread backward)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10496 (let ((keystrokes '((?\C-n (gnus-group-next-unread-group 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10497 (?\C-p (gnus-group-prev-unread-group 1))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10498 keve key group ended)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10499 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10500 (set-buffer gnus-group-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10501 (gnus-summary-jump-to-group from-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10502 (setq group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10503 (if (eq gnus-keep-same-level 'best)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10504 (gnus-summary-best-group gnus-newsgroup-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10505 (gnus-summary-search-group backward gnus-keep-same-level))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10506 (while (not ended)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10507 (gnus-message
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10508 5 "No more%s articles%s" (if unread " unread" "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10509 (if (and group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10510 (not (gnus-ephemeral-group-p gnus-newsgroup-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10511 (format " (Type %s for %s [%s])"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10512 (single-key-description cmd) group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10513 (car (gnus-gethash group gnus-newsrc-hashtb)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10514 (format " (Type %s to exit %s)"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10515 (single-key-description cmd)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10516 gnus-newsgroup-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10517 ;; Confirm auto selection.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10518 (setq key (car (setq keve (gnus-read-event-char))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10519 (setq ended t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10520 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10521 ((assq key keystrokes)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10522 (let ((obuf (current-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10523 (switch-to-buffer gnus-group-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10524 (and group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10525 (gnus-group-jump-to-group group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10526 (eval (cadr (assq key keystrokes)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10527 (setq group (gnus-group-group-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10528 (switch-to-buffer obuf))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10529 (setq ended nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10530 ((equal key cmd)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10531 (if (or (not group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10532 (gnus-ephemeral-group-p gnus-newsgroup-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10533 (gnus-summary-exit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10534 (gnus-summary-next-group nil group backward)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10535 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10536 (push (cdr keve) unread-command-events))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10537
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10538 (defun gnus-read-event-char ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10539 "Get the next event."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10540 (let ((event (read-event)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10541 (cons (and (numberp event) event) event)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10542
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10543 (defun gnus-summary-next-unread-article ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10544 "Select unread article after current one."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10545 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10546 (gnus-summary-next-article t (and gnus-auto-select-same
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10547 (gnus-summary-article-subject))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10548
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10549 (defun gnus-summary-prev-article (&optional unread subject)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10550 "Select the article after the current one.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10551 If UNREAD is non-nil, only unread articles are selected."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10552 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10553 (gnus-summary-next-article unread subject t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10554
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10555 (defun gnus-summary-prev-unread-article ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10556 "Select unred article before current one."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10557 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10558 (gnus-summary-prev-article t (and gnus-auto-select-same
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10559 (gnus-summary-article-subject))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10560
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10561 (defun gnus-summary-next-page (&optional lines circular)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10562 "Show next page of the selected article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10563 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
10564 LINES says how many lines should be scrolled up.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10565
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10566 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
10567 selecting the next article when reaching the end of the current
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10568 article."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10569 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10570 (setq gnus-summary-buffer (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10571 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10572 (let ((article (gnus-summary-article-number))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10573 (endp nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10574 (gnus-configure-windows 'article)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10575 (if (eq (cdr (assq article gnus-newsgroup-reads)) gnus-canceled-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10576 (if (and (eq gnus-summary-goto-unread 'never)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10577 (not (gnus-summary-last-article-p article)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10578 (gnus-summary-next-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10579 (gnus-summary-next-unread-article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10580 (if (or (null gnus-current-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10581 (null gnus-article-current)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10582 (/= article (cdr gnus-article-current))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10583 (not (equal (car gnus-article-current) gnus-newsgroup-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10584 ;; Selected subject is different from current article's.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10585 (gnus-summary-display-article article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10586 (gnus-eval-in-buffer-window gnus-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10587 (setq endp (gnus-article-next-page lines)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10588 (if endp
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10589 (cond (circular
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10590 (gnus-summary-beginning-of-article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10591 (lines
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10592 (gnus-message 3 "End of message"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10593 ((null lines)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10594 (if (and (eq gnus-summary-goto-unread 'never)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10595 (not (gnus-summary-last-article-p article)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10596 (gnus-summary-next-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10597 (gnus-summary-next-unread-article)))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10598 (gnus-summary-recenter)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10599 (gnus-summary-position-point)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10600
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10601 (defun gnus-summary-prev-page (&optional lines)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10602 "Show previous page of selected article.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10603 Argument LINES specifies lines to be scrolled down."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10604 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10605 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10606 (let ((article (gnus-summary-article-number)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10607 (gnus-configure-windows 'article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10608 (if (or (null gnus-current-article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10609 (null gnus-article-current)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10610 (/= article (cdr gnus-article-current))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10611 (not (equal (car gnus-article-current) gnus-newsgroup-name)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10612 ;; Selected subject is different from current article's.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10613 (gnus-summary-display-article article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10614 (gnus-summary-recenter)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10615 (gnus-eval-in-buffer-window gnus-article-buffer
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10616 (gnus-article-prev-page lines))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10617 (gnus-summary-position-point))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10618
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10619 (defun gnus-summary-scroll-up (lines)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10620 "Scroll up (or down) one line current article.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10621 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
10622 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10623 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10624 (gnus-configure-windows 'article)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10625 (gnus-summary-show-thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10626 (when (eq (gnus-summary-select-article nil nil 'pseudo) 'old)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10627 (gnus-eval-in-buffer-window gnus-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10628 (cond ((> lines 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10629 (if (gnus-article-next-page lines)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10630 (gnus-message 3 "End of message")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10631 ((< lines 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10632 (gnus-article-prev-page (- lines))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10633 (gnus-summary-recenter)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10634 (gnus-summary-position-point))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10635
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10636 (defun gnus-summary-next-same-subject ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10637 "Select next article which has the same subject as current one."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10638 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10639 (gnus-set-global-variables)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10640 (gnus-summary-next-article nil (gnus-summary-article-subject)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10641
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10642 (defun gnus-summary-prev-same-subject ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10643 "Select previous article which has the same subject as current one."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10644 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10645 (gnus-set-global-variables)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10646 (gnus-summary-prev-article nil (gnus-summary-article-subject)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10647
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10648 (defun gnus-summary-next-unread-same-subject ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10649 "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
10650 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10651 (gnus-set-global-variables)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10652 (gnus-summary-next-article t (gnus-summary-article-subject)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10653
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10654 (defun gnus-summary-prev-unread-same-subject ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10655 "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
10656 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10657 (gnus-set-global-variables)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10658 (gnus-summary-prev-article t (gnus-summary-article-subject)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10659
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10660 (defun gnus-summary-first-unread-article ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10661 "Select the first unread article.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10662 Return nil if there are no unread articles."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10663 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10664 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10665 (prog1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10666 (if (gnus-summary-first-subject t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10667 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10668 (gnus-summary-show-thread)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10669 (gnus-summary-first-subject t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10670 (gnus-summary-display-article (gnus-summary-article-number))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10671 (gnus-summary-position-point)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10672
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10673 (defun gnus-summary-best-unread-article ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10674 "Select the unread article with the highest score."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10675 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10676 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10677 (let ((best -1000000)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10678 (data gnus-newsgroup-data)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10679 article score)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10680 (while data
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10681 (and (gnus-data-unread-p (car data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10682 (> (setq score
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10683 (gnus-summary-article-score (gnus-data-number (car data))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10684 best)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10685 (setq best score
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10686 article (gnus-data-number (car data))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10687 (setq data (cdr data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10688 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10689 (if article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10690 (gnus-summary-goto-article article)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10691 (error "No unread articles"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10692 (gnus-summary-position-point))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10693
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10694 (defun gnus-summary-last-subject ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10695 "Go to the last displayed subject line in the group."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10696 (let ((article (gnus-data-number (car (gnus-data-list t)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10697 (when article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10698 (gnus-summary-goto-subject article))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10699
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10700 (defun gnus-summary-goto-article (article &optional all-headers force)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10701 "Fetch ARTICLE and display it if it exists.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10702 If ALL-HEADERS is non-nil, no header lines are hidden."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10703 (interactive
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10704 (list
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10705 (string-to-int
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10706 (completing-read
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10707 "Article number: "
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10708 (mapcar (lambda (number) (list (int-to-string number)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10709 gnus-newsgroup-limit)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10710 current-prefix-arg
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10711 t))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10712 (prog1
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10713 (if (gnus-summary-goto-subject article force)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10714 (gnus-summary-display-article article all-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10715 (gnus-message 4 "Couldn't go to article %s" article) nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10716 (gnus-summary-position-point)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10717
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10718 (defun gnus-summary-goto-last-article ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10719 "Go to the previously read article."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10720 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10721 (prog1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10722 (and gnus-last-article
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10723 (gnus-summary-goto-article gnus-last-article))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10724 (gnus-summary-position-point)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10725
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10726 (defun gnus-summary-pop-article (number)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10727 "Pop one article off the history and go to the previous.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10728 NUMBER articles will be popped off."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10729 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10730 (let (to)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10731 (setq gnus-newsgroup-history
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10732 (cdr (setq to (nthcdr number gnus-newsgroup-history))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10733 (if to
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10734 (gnus-summary-goto-article (car to))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10735 (error "Article history empty")))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10736 (gnus-summary-position-point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10737
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10738 ;; Summary commands and functions for limiting the summary buffer.
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 (defun gnus-summary-limit-to-articles (n)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10741 "Limit the summary buffer to the next N articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10742 If not given a prefix, use the process marked articles instead."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10743 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10744 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10745 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10746 (let ((articles (gnus-summary-work-articles n)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10747 (setq gnus-newsgroup-processable nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10748 (gnus-summary-limit articles))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10749 (gnus-summary-position-point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10750
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10751 (defun gnus-summary-pop-limit (&optional total)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10752 "Restore the previous limit.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10753 If given a prefix, remove all limits."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10754 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10755 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10756 (when total
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10757 (setq gnus-newsgroup-limits
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10758 (list (mapcar (lambda (h) (mail-header-number h))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10759 gnus-newsgroup-headers))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10760 (unless gnus-newsgroup-limits
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10761 (error "No limit to pop"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10762 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10763 (gnus-summary-limit nil 'pop)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10764 (gnus-summary-position-point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10765
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10766 (defun gnus-summary-limit-to-subject (subject &optional header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10767 "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
10768 (interactive "sRegexp: ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10769 (unless header
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10770 (setq header "subject"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10771 (when (not (equal "" subject))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10772 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10773 (let ((articles (gnus-summary-find-matching
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10774 (or header "subject") subject 'all)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10775 (or articles (error "Found no matches for \"%s\"" subject))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10776 (gnus-summary-limit articles))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10777 (gnus-summary-position-point))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10778
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10779 (defun gnus-summary-limit-to-author (from)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10780 "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
10781 (interactive "sRegexp: ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10782 (gnus-summary-limit-to-subject from "from"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10783
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10784 (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
10785 (make-obsolete
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10786 '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
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10788 (defun gnus-summary-limit-to-unread (&optional all)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10789 "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
10790 If ALL is non-nil, limit strictly to unread articles."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10791 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10792 (if all
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10793 (gnus-summary-limit-to-marks (char-to-string gnus-unread-mark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10794 (gnus-summary-limit-to-marks
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10795 ;; 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
10796 ;; those removed.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10797 (list gnus-del-mark gnus-read-mark gnus-ancient-mark
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10798 gnus-killed-mark gnus-kill-file-mark
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10799 gnus-low-score-mark gnus-expirable-mark
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10800 gnus-canceled-mark gnus-catchup-mark gnus-sparse-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10801 'reverse)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10802
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10803 (defalias 'gnus-summary-delete-marked-with 'gnus-summary-limit-to-marks)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10804 (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
10805
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10806 (defun gnus-summary-limit-to-marks (marks &optional reverse)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10807 "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
10808 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
10809 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
10810 Returns how many articles were removed."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10811 (interactive "sMarks: ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10812 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10813 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10814 (let ((data gnus-newsgroup-data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10815 (marks (if (listp marks) marks
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10816 (append marks nil))) ; Transform to list.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10817 articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10818 (while data
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10819 (and (if reverse (not (memq (gnus-data-mark (car data)) marks))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10820 (memq (gnus-data-mark (car data)) marks))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10821 (setq articles (cons (gnus-data-number (car data)) articles)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10822 (setq data (cdr data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10823 (gnus-summary-limit articles))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10824 (gnus-summary-position-point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10825
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10826 (defun gnus-summary-limit-to-score (&optional score)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10827 "Limit to articles with score at or above SCORE."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10828 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10829 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10830 (setq score (if score
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10831 (prefix-numeric-value score)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10832 (or gnus-summary-default-score 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10833 (let ((data gnus-newsgroup-data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10834 articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10835 (while data
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10836 (when (>= (gnus-summary-article-score (gnus-data-number (car data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10837 score)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10838 (push (gnus-data-number (car data)) articles))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10839 (setq data (cdr data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10840 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10841 (gnus-summary-limit articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10842 (gnus-summary-position-point))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10843
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10844 (defun gnus-summary-limit-include-dormant ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10845 "Display all the hidden articles that are marked as dormant."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10846 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10847 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10848 (or gnus-newsgroup-dormant
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10849 (error "There are no dormant articles in this group"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10850 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10851 (gnus-summary-limit (append gnus-newsgroup-dormant gnus-newsgroup-limit))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10852 (gnus-summary-position-point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10853
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10854 (defun gnus-summary-limit-exclude-dormant ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10855 "Hide all dormant articles."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10856 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10857 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10858 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10859 (gnus-summary-limit-to-marks (list gnus-dormant-mark) 'reverse)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10860 (gnus-summary-position-point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10861
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10862 (defun gnus-summary-limit-exclude-childless-dormant ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10863 "Hide all dormant articles that have no children."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10864 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10865 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10866 (let ((data (gnus-data-list t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10867 articles d children)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10868 ;; Find all articles that are either not dormant or have
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10869 ;; children.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10870 (while (setq d (pop data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10871 (when (or (not (= (gnus-data-mark d) gnus-dormant-mark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10872 (and (setq children
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10873 (gnus-article-children (gnus-data-number d)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10874 (let (found)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10875 (while children
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10876 (when (memq (car children) articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10877 (setq children nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10878 found t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10879 (pop children))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10880 found)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10881 (push (gnus-data-number d) articles)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10882 ;; Do the limiting.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10883 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10884 (gnus-summary-limit articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10885 (gnus-summary-position-point))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10886
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10887 (defun gnus-summary-limit-mark-excluded-as-read (&optional all)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10888 "Mark all unread excluded articles as read.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10889 If ALL, mark even excluded ticked and dormants as read."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10890 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10891 (let ((articles (gnus-sorted-complement
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10892 (sort
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10893 (mapcar (lambda (h) (mail-header-number h))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10894 gnus-newsgroup-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10895 '<)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10896 (sort gnus-newsgroup-limit '<)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10897 article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10898 (setq gnus-newsgroup-unreads nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10899 (if all
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10900 (setq gnus-newsgroup-dormant nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10901 gnus-newsgroup-marked nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10902 gnus-newsgroup-reads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10903 (nconc
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10904 (mapcar (lambda (n) (cons n gnus-catchup-mark)) articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10905 gnus-newsgroup-reads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10906 (while (setq article (pop articles))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10907 (unless (or (memq article gnus-newsgroup-dormant)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10908 (memq article gnus-newsgroup-marked))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10909 (push (cons article gnus-catchup-mark) gnus-newsgroup-reads))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10910
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10911 (defun gnus-summary-limit (articles &optional pop)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10912 (if pop
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10913 ;; We pop the previous limit off the stack and use that.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10914 (setq articles (car gnus-newsgroup-limits)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10915 gnus-newsgroup-limits (cdr gnus-newsgroup-limits))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10916 ;; 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
10917 (setq gnus-newsgroup-limits
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10918 (cons gnus-newsgroup-limit gnus-newsgroup-limits)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10919 ;; Set the limit.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10920 (setq gnus-newsgroup-limit articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10921 (let ((total (length gnus-newsgroup-data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10922 (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
10923 (gnus-summary-mark-below nil) ; Inhibit this.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10924 found)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10925 ;; 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
10926 ;; according to the new limit.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10927 (gnus-summary-prepare)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10928 ;; Hide any threads, possibly.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10929 (and gnus-show-threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10930 gnus-thread-hide-subtree
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10931 (gnus-summary-hide-all-threads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10932 ;; 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
10933 ;; neighborhood.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10934 (if data
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10935 ;; We try to find some article after the current one.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10936 (while data
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10937 (and (gnus-summary-goto-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10938 (gnus-data-number (car data)) nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10939 (setq data nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10940 found t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10941 (setq data (cdr data))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10942 (or found
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10943 ;; 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
10944 ;; article. The same goes when we can't find any articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10945 ;; after the current one.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10946 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10947 (goto-char (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10948 (gnus-summary-find-prev)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10949 ;; We return how many articles were removed from the summary
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10950 ;; buffer as a result of the new limit.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10951 (- total (length gnus-newsgroup-data))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10952
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10953 (defsubst gnus-invisible-cut-children (threads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10954 (let ((num 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10955 (while threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10956 (when (memq (mail-header-number (caar threads)) gnus-newsgroup-limit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10957 (incf num))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10958 (pop threads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10959 (< num 2)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10960
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10961 (defsubst gnus-cut-thread (thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10962 "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
10963 (when (or (eq gnus-fetch-old-headers 'some)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10964 (eq gnus-build-sparse-threads 'some)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10965 (eq gnus-build-sparse-threads 'more))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10966 ;; Deal with old-fetched headers and sparse threads.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10967 (while (and
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10968 thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10969 (or
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10970 (memq (mail-header-number (car thread)) gnus-newsgroup-sparse)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10971 (memq (mail-header-number (car thread)) gnus-newsgroup-ancient))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10972 (or (<= (length (cdr thread)) 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10973 (gnus-invisible-cut-children (cdr thread))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10974 (setq thread (cadr thread))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10975 thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10976
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10977 (defun gnus-cut-threads (threads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10978 "Cut off all uninteresting articles from the beginning of threads."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10979 (when (or (eq gnus-fetch-old-headers 'some)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10980 (eq gnus-build-sparse-threads 'some)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10981 (eq gnus-build-sparse-threads 'more))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10982 (let ((th threads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10983 (while th
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10984 (setcar th (gnus-cut-thread (car th)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10985 (setq th (cdr th)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10986 ;; Remove nixed out threads.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10987 (delq nil threads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10988
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10989 (defun gnus-summary-initial-limit (&optional show-if-empty)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10990 "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
10991 This entails weeding out unwanted dormants, low-scored articles,
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10992 fetch-old-headers verbiage, and so on."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10993 ;; Most groups have nothing to remove.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10994 (if (or gnus-inhibit-limiting
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10995 (and (null gnus-newsgroup-dormant)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10996 (not (eq gnus-fetch-old-headers 'some))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10997 (null gnus-summary-expunge-below)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10998 (not (eq gnus-build-sparse-threads 'some))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10999 (not (eq gnus-build-sparse-threads 'more))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11000 (null gnus-thread-expunge-below)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11001 (not gnus-use-nocem)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11002 () ; Do nothing.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11003 (push gnus-newsgroup-limit gnus-newsgroup-limits)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11004 (setq gnus-newsgroup-limit nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11005 (mapatoms
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11006 (lambda (node)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11007 (unless (car (symbol-value node))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11008 ;; These threads have no parents -- they are roots.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11009 (let ((nodes (cdr (symbol-value node)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11010 thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11011 (while nodes
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11012 (if (and gnus-thread-expunge-below
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11013 (< (gnus-thread-total-score (car nodes))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11014 gnus-thread-expunge-below))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11015 (gnus-expunge-thread (pop nodes))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11016 (setq thread (pop nodes))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11017 (gnus-summary-limit-children thread))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11018 gnus-newsgroup-dependencies)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11019 ;; If this limitation resulted in an empty group, we might
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11020 ;; pop the previous limit and use it instead.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11021 (when (and (not gnus-newsgroup-limit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11022 show-if-empty)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11023 (setq gnus-newsgroup-limit (pop gnus-newsgroup-limits)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11024 gnus-newsgroup-limit))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11025
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11026 (defun gnus-summary-limit-children (thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11027 "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
11028 ;; 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
11029 ;; 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
11030 ;; will really go down to a leaf article first, before slowly
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11031 ;; working its way up towards the root.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11032 (when thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11033 (let ((children
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11034 (if (cdr thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11035 (apply '+ (mapcar 'gnus-summary-limit-children
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11036 (cdr thread)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11037 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11038 (number (mail-header-number (car thread)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11039 score)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11040 (if (or
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11041 ;; If this article is dormant and has absolutely no visible
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11042 ;; children, then this article isn't visible.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11043 (and (memq number gnus-newsgroup-dormant)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11044 (= children 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11045 ;; If this is "fetch-old-headered" and there is only one
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11046 ;; visible child (or less), then we don't want this article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11047 (and (eq gnus-fetch-old-headers 'some)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11048 (memq number gnus-newsgroup-ancient)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11049 (zerop children))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11050 ;; If this is a sparsely inserted article with no children,
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11051 ;; we don't want it.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11052 (and (eq gnus-build-sparse-threads 'some)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11053 (memq number gnus-newsgroup-sparse)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11054 (zerop children))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11055 ;; If we use expunging, and this article is really
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11056 ;; low-scored, then we don't want this article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11057 (when (and gnus-summary-expunge-below
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11058 (< (setq score
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11059 (or (cdr (assq number gnus-newsgroup-scored))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11060 gnus-summary-default-score))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11061 gnus-summary-expunge-below))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11062 ;; We increase the expunge-tally here, but that has
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11063 ;; nothing to do with the limits, really.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11064 (incf gnus-newsgroup-expunged-tally)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11065 ;; We also mark as read here, if that's wanted.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11066 (when (and gnus-summary-mark-below
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11067 (< score gnus-summary-mark-below))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11068 (setq gnus-newsgroup-unreads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11069 (delq number gnus-newsgroup-unreads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11070 (if gnus-newsgroup-auto-expire
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11071 (push number gnus-newsgroup-expirable)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11072 (push (cons number gnus-low-score-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11073 gnus-newsgroup-reads)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11074 t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11075 (and gnus-use-nocem
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11076 (gnus-nocem-unwanted-article-p (mail-header-id (car thread)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11077 ;; Nope, invisible article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11078 0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11079 ;; 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
11080 ;; and return 1.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11081 (setq gnus-newsgroup-limit (cons number gnus-newsgroup-limit))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11082 1))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11083
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11084 (defun gnus-expunge-thread (thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11085 "Mark all articles in THREAD as read."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11086 (let* ((number (mail-header-number (car thread))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11087 (incf gnus-newsgroup-expunged-tally)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11088 ;; We also mark as read here, if that's wanted.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11089 (setq gnus-newsgroup-unreads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11090 (delq number gnus-newsgroup-unreads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11091 (if gnus-newsgroup-auto-expire
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11092 (push number gnus-newsgroup-expirable)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11093 (push (cons number gnus-low-score-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11094 gnus-newsgroup-reads)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11095 ;; Go recursively through all subthreads.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11096 (mapcar 'gnus-expunge-thread (cdr thread)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11097
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11098 ;; Summary article oriented commands
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 (defun gnus-summary-refer-parent-article (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11101 "Refer parent article N times.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11102 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
11103 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11104 (gnus-set-global-variables)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11105 (while
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11106 (and
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11107 (> n 0)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11108 (let* ((header (gnus-summary-article-header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11109 (ref
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11110 ;; If we try to find the parent of the currently
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11111 ;; displayed article, then we take a look at the actual
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11112 ;; References header, since this is slightly more
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11113 ;; reliable than the References field we got from the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11114 ;; server.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11115 (if (and (eq (mail-header-number header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11116 (cdr gnus-article-current))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11117 (equal gnus-newsgroup-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11118 (car gnus-article-current)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11119 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11120 (set-buffer gnus-original-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11121 (nnheader-narrow-to-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11122 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11123 (message-fetch-field "references")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11124 (widen)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11125 ;; 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
11126 ;; the value we got from the server.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11127 (mail-header-references header))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11128 (if (setq ref (or ref (mail-header-references header)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11129 (or (gnus-summary-refer-article (gnus-parent-id ref))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11130 (gnus-message 1 "Couldn't find parent"))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11131 (gnus-message 1 "No references in article %d"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11132 (gnus-summary-article-number))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11133 nil)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11134 (setq n (1- n)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11135 (gnus-summary-position-point)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11136 n)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11137
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11138 (defun gnus-summary-refer-references ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11139 "Fetch all articles mentioned in the References header.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11140 Return how many articles were fetched."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11141 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11142 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11143 (let ((ref (mail-header-references (gnus-summary-article-header)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11144 (current (gnus-summary-article-number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11145 (n 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11146 ;; For each Message-ID in the References header...
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11147 (while (string-match "<[^>]*>" ref)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11148 (incf n)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11149 ;; ... fetch that article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11150 (gnus-summary-refer-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11151 (prog1 (match-string 0 ref)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11152 (setq ref (substring ref (match-end 0))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11153 (gnus-summary-goto-subject current)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11154 (gnus-summary-position-point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11155 n))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11156
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11157 (defun gnus-summary-refer-article (message-id)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11158 "Fetch an article specified by MESSAGE-ID."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11159 (interactive "sMessage-ID: ")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11160 (when (and (stringp message-id)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11161 (not (zerop (length message-id))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11162 ;; Construct the correct Message-ID if necessary.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11163 ;; Suggested by tale@pawl.rpi.edu.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11164 (unless (string-match "^<" message-id)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11165 (setq message-id (concat "<" message-id)))
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 (let* ((header (gnus-id-to-header message-id))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11169 (sparse (and header
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11170 (memq (mail-header-number header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11171 gnus-newsgroup-sparse))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11172 (if header
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11173 (prog1
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11174 ;; 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
11175 (gnus-summary-goto-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11176 (mail-header-number header) nil header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11177 (when sparse
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11178 (gnus-summary-update-article (mail-header-number header))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11179 ;; We fetch the article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11180 (let ((gnus-override-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11181 (and (gnus-news-group-p gnus-newsgroup-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11182 gnus-refer-article-method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11183 number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11184 ;; Start the special refer-article method, if necessary.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11185 (when (and gnus-refer-article-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11186 (gnus-news-group-p gnus-newsgroup-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11187 (gnus-check-server gnus-refer-article-method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11188 ;; Fetch the header, and display the article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11189 (if (setq number (gnus-summary-insert-subject message-id))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11190 (gnus-summary-select-article nil nil nil number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11191 (gnus-message 3 "Couldn't fetch article %s" message-id)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11192
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11193 (defun gnus-summary-enter-digest-group (&optional force)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11194 "Enter a digest group based on the current article."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11195 (interactive "P")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11196 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11197 (gnus-summary-select-article)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11198 (let ((name (format "%s-%d"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11199 (gnus-group-prefixed-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11200 gnus-newsgroup-name (list 'nndoc ""))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11201 gnus-current-article))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11202 (ogroup gnus-newsgroup-name)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11203 (case-fold-search t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11204 (buf (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11205 dig)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11206 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11207 (setq dig (nnheader-set-temp-buffer " *gnus digest buffer*"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11208 (insert-buffer-substring gnus-original-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11209 (narrow-to-region
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11210 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11211 (or (search-forward "\n\n" nil t) (point)))
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 (delete-matching-lines "^\\(Path\\):\\|^From ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11214 (widen))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11215 (unwind-protect
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11216 (if (gnus-group-read-ephemeral-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11217 name `(nndoc ,name (nndoc-address
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11218 ,(get-buffer dig))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11219 (nndoc-article-type ,(if force 'digest 'guess))) t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11220 ;; Make all postings to this group go to the parent group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11221 (nconc (gnus-info-params (gnus-get-info name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11222 (list (cons 'to-group ogroup)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11223 ;; Couldn't select this doc group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11224 (switch-to-buffer buf)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11225 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11226 (gnus-configure-windows 'summary)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11227 (gnus-message 3 "Article couldn't be entered?"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11228 (kill-buffer dig))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11229
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11230 (defun gnus-summary-isearch-article (&optional regexp-p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11231 "Do incremental search forward on the current article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11232 If REGEXP-P (the prefix) is non-nil, do regexp isearch."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11233 (interactive "P")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11234 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11235 (gnus-summary-select-article)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11236 (gnus-configure-windows 'article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11237 (gnus-eval-in-buffer-window gnus-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11238 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11239 (isearch-forward regexp-p)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11240
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11241 (defun gnus-summary-search-article-forward (regexp &optional backward)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11242 "Search for an article containing REGEXP forward.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11243 If BACKWARD, search backward instead."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11244 (interactive
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11245 (list (read-string
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11246 (format "Search article %s (regexp%s): "
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11247 (if current-prefix-arg "backward" "forward")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11248 (if gnus-last-search-regexp
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11249 (concat ", default " gnus-last-search-regexp)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11250 "")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11251 current-prefix-arg))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11252 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11253 (if (string-equal regexp "")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11254 (setq regexp (or gnus-last-search-regexp ""))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11255 (setq gnus-last-search-regexp regexp))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11256 (unless (gnus-summary-search-article regexp backward)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11257 (error "Search failed: \"%s\"" regexp)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11258
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11259 (defun gnus-summary-search-article-backward (regexp)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11260 "Search for an article containing REGEXP backward."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11261 (interactive
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11262 (list (read-string
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11263 (format "Search article backward (regexp%s): "
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11264 (if gnus-last-search-regexp
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11265 (concat ", default " gnus-last-search-regexp)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11266 "")))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11267 (gnus-summary-search-article-forward regexp 'backward))
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 (defun gnus-summary-search-article (regexp &optional backward)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11270 "Search for an article containing REGEXP.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11271 Optional argument BACKWARD means do search for backward.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11272 `gnus-select-article-hook' is not called during the search."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11273 (let ((gnus-select-article-hook nil) ;Disable hook.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11274 (gnus-article-display-hook nil)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11275 (gnus-mark-article-hook nil) ;Inhibit marking as read.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11276 (re-search
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11277 (if backward
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11278 're-search-backward 're-search-forward))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11279 (sum (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11280 (found nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11281 (gnus-save-hidden-threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11282 (gnus-summary-select-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11283 (set-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11284 (when backward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11285 (forward-line -1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11286 (while (not found)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11287 (gnus-message 7 "Searching article: %d..." (cdr gnus-article-current))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11288 (if (if backward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11289 (re-search-backward regexp nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11290 (re-search-forward regexp nil t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11291 ;; We found the regexp.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11292 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11293 (setq found 'found)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11294 (beginning-of-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11295 (set-window-start
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11296 (get-buffer-window (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11297 (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11298 (forward-line 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11299 (set-buffer sum))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11300 ;; 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
11301 (set-buffer sum)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11302 (if (not (if backward (gnus-summary-find-prev)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11303 (gnus-summary-find-next)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11304 ;; No more articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11305 (setq found t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11306 ;; Select the next article and adjust point.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11307 (gnus-summary-select-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11308 (set-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11309 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11310 (goto-char (if backward (point-max) (point-min))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11311 (gnus-message 7 ""))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11312 ;; Return whether we found the regexp.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11313 (when (eq found 'found)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11314 (gnus-summary-show-thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11315 (gnus-summary-goto-subject gnus-current-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11316 (gnus-summary-position-point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11317 t)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11318
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11319 (defun gnus-summary-find-matching (header regexp &optional backward unread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11320 not-case-fold)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11321 "Return a list of all articles that match REGEXP on HEADER.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11322 The search stars on the current article and goes forwards unless
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11323 BACKWARD is non-nil. If BACKWARD is `all', do all articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11324 If UNREAD is non-nil, only unread articles will
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11325 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
11326 in the comparisons."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11327 (let ((data (if (eq backward 'all) gnus-newsgroup-data
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11328 (gnus-data-find-list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11329 (gnus-summary-article-number) (gnus-data-list backward))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11330 (func `(lambda (h) (,(intern (concat "mail-header-" header)) h)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11331 (case-fold-search (not not-case-fold))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11332 articles d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11333 (or (fboundp (intern (concat "mail-header-" header)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11334 (error "%s is not a valid header" header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11335 (while data
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11336 (setq d (car data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11337 (and (or (not unread) ; We want all articles...
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11338 (gnus-data-unread-p d)) ; Or just unreads.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11339 (vectorp (gnus-data-header d)) ; It's not a pseudo.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11340 (string-match regexp (funcall func (gnus-data-header d))) ; Match.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11341 (setq articles (cons (gnus-data-number d) articles))) ; Success!
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11342 (setq data (cdr data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11343 (nreverse articles)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11344
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11345 (defun gnus-summary-execute-command (header regexp command &optional backward)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11346 "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
11347 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
11348 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
11349 (interactive
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11350 (list (let ((completion-ignore-case t))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11351 (completing-read
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11352 "Header name: "
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11353 (mapcar (lambda (string) (list string))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11354 '("Number" "Subject" "From" "Lines" "Date"
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11355 "Message-ID" "Xref" "References" "Body"))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11356 nil 'require-match))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11357 (read-string "Regexp: ")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11358 (read-key-sequence "Command: ")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11359 current-prefix-arg))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11360 (when (equal header "Body")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11361 (setq header ""))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11362 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11363 ;; Hidden thread subtrees must be searched as well.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11364 (gnus-summary-show-all-threads)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11365 ;; We don't want to change current point nor window configuration.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11366 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11367 (save-window-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11368 (gnus-message 6 "Executing %s..." (key-description command))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11369 ;; 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
11370 (gnus-execute header regexp
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11371 `(lambda () (call-interactively ',(key-binding command)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11372 backward)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11373 (gnus-message 6 "Executing %s...done" (key-description command)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11374
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11375 (defun gnus-summary-beginning-of-article ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11376 "Scroll the article back to the beginning."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11377 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11378 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11379 (gnus-summary-select-article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11380 (gnus-configure-windows 'article)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11381 (gnus-eval-in-buffer-window gnus-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11382 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11383 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11384 (and gnus-break-pages (gnus-narrow-to-page))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11385
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11386 (defun gnus-summary-end-of-article ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11387 "Scroll to the end of the article."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11388 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11389 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11390 (gnus-summary-select-article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11391 (gnus-configure-windows 'article)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11392 (gnus-eval-in-buffer-window gnus-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11393 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11394 (goto-char (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11395 (recenter -3)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11396 (and gnus-break-pages (gnus-narrow-to-page))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11397
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11398 (defun gnus-summary-show-article (&optional arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11399 "Force re-fetching of the current article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11400 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
11401 article massaging functions being run."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11402 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11403 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11404 (if (not arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11405 ;; Select the article the normal way.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11406 (gnus-summary-select-article nil 'force)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11407 ;; Bind the article treatment functions to nil.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11408 (let ((gnus-have-all-headers t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11409 gnus-article-display-hook
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11410 gnus-article-prepare-hook
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11411 gnus-break-pages
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11412 gnus-visual)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11413 (gnus-summary-select-article nil 'force)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11414 (gnus-summary-goto-subject gnus-current-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11415 ; (gnus-configure-windows 'article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11416 (gnus-summary-position-point))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11417
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11418 (defun gnus-summary-verbose-headers (&optional arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11419 "Toggle permanent full header display.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11420 If ARG is a positive number, turn header display on.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11421 If ARG is a negative number, turn header display off."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11422 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11423 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11424 (gnus-summary-toggle-header arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11425 (setq gnus-show-all-headers
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11426 (cond ((or (not (numberp arg))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11427 (zerop arg))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11428 (not gnus-show-all-headers))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11429 ((natnump arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11430 t))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11431
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11432 (defun gnus-summary-toggle-header (&optional arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11433 "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
11434 If ARG is a positive number, show the entire header.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11435 If ARG is a negative number, hide the unwanted header lines."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11436 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11437 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11438 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11439 (set-buffer gnus-article-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11440 (let* ((buffer-read-only nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11441 (inhibit-point-motion-hooks t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11442 (hidden (text-property-any
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11443 (goto-char (point-min)) (search-forward "\n\n")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11444 'invisible t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11445 e)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11446 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11447 (when (search-forward "\n\n" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11448 (delete-region (point-min) (1- (point))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11449 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11450 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11451 (set-buffer gnus-original-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11452 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11453 (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
11454 (insert-buffer-substring gnus-original-article-buffer 1 e)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11455 (let ((gnus-inhibit-hiding t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11456 (run-hooks 'gnus-article-display-hook))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11457 (if (or (not hidden) (and (numberp arg) (< arg 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11458 (gnus-article-hide-headers)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11459
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11460 (defun gnus-summary-show-all-headers ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11461 "Make all header lines visible."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11462 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11463 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11464 (gnus-article-show-all-headers))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11465
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11466 (defun gnus-summary-toggle-mime (&optional arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11467 "Toggle MIME processing.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11468 If ARG is a positive number, turn MIME processing on."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11469 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11470 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11471 (setq gnus-show-mime
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11472 (if (null arg) (not gnus-show-mime)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11473 (> (prefix-numeric-value arg) 0)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11474 (gnus-summary-select-article t 'force))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11475
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11476 (defun gnus-summary-caesar-message (&optional arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11477 "Caesar rotate the current article by 13.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11478 The numerical prefix specifies how manu places to rotate each letter
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11479 forward."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11480 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11481 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11482 (gnus-summary-select-article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11483 (let ((mail-header-separator ""))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11484 (gnus-eval-in-buffer-window gnus-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11485 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11486 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11487 (let ((start (window-start))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11488 buffer-read-only)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11489 (message-caesar-buffer-body arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11490 (set-window-start (get-buffer-window (current-buffer)) start))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11491
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11492 (defun gnus-summary-stop-page-breaking ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11493 "Stop page breaking in the current article."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11494 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11495 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11496 (gnus-summary-select-article)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11497 (gnus-eval-in-buffer-window gnus-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11498 (widen)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11499
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11500 (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
11501 "Move the current article to a different newsgroup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11502 If N is a positive number, move the N next articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11503 If N is a negative number, move the N previous articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11504 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
11505 move those articles instead.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11506 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
11507 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
11508 re-spool using this method.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11509
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11510 For this function to work, both the current newsgroup and the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11511 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
11512 and `request-accept' functions."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11513 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11514 (unless action (setq action 'move))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11515 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11516 ;; Check whether the source group supports the required functions.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11517 (cond ((and (eq action 'move)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11518 (not (gnus-check-backend-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11519 'request-move-article gnus-newsgroup-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11520 (error "The current group does not support article moving"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11521 ((and (eq action 'crosspost)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11522 (not (gnus-check-backend-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11523 'request-replace-article gnus-newsgroup-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11524 (error "The current group does not support article editing")))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11525 (let ((articles (gnus-summary-work-articles n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11526 (prefix (gnus-group-real-prefix gnus-newsgroup-name))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11527 (names '((move "Move" "Moving")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11528 (copy "Copy" "Copying")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11529 (crosspost "Crosspost" "Crossposting")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11530 (copy-buf (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11531 (nnheader-set-temp-buffer " *copy article*")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11532 art-group to-method new-xref article to-groups)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11533 (unless (assq action names)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11534 (error "Unknown action %s" action))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11535 ;; Read the newsgroup name.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11536 (when (and (not to-newsgroup)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11537 (not select-method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11538 (setq to-newsgroup
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11539 (gnus-read-move-group-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11540 (cadr (assq action names))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11541 (symbol-value (intern (format "gnus-current-%s-group" action)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11542 articles prefix))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11543 (set (intern (format "gnus-current-%s-group" action)) to-newsgroup))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11544 (setq to-method (or select-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11545 (gnus-group-name-to-method to-newsgroup)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11546 ;; Check the method we are to move this article to...
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11547 (or (gnus-check-backend-function 'request-accept-article (car to-method))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11548 (error "%s does not support article copying" (car to-method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11549 (or (gnus-check-server to-method)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11550 (error "Can't open server %s" (car to-method)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11551 (gnus-message 6 "%s to %s: %s..."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11552 (caddr (assq action names))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11553 (or (car select-method) to-newsgroup) articles)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11554 (while articles
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11555 (setq article (pop articles))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11556 (setq
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11557 art-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11558 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11559 ;; Move the article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11560 ((eq action 'move)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11561 (gnus-request-move-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11562 article ; Article to move
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11563 gnus-newsgroup-name ; From newsgrouo
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11564 (nth 1 (gnus-find-method-for-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11565 gnus-newsgroup-name)) ; Server
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11566 (list 'gnus-request-accept-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11567 to-newsgroup (list 'quote select-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11568 (not articles)) ; Accept form
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11569 (not articles))) ; Only save nov last time
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11570 ;; Copy the article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11571 ((eq action 'copy)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11572 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11573 (set-buffer copy-buf)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11574 (gnus-request-article-this-buffer article gnus-newsgroup-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11575 (gnus-request-accept-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11576 to-newsgroup select-method (not articles))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11577 ;; Crosspost the article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11578 ((eq action 'crosspost)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11579 (let ((xref (mail-header-xref (gnus-summary-article-header article))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11580 (setq new-xref (concat gnus-newsgroup-name ":" article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11581 (if (and xref (not (string= xref "")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11582 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11583 (when (string-match "^Xref: " xref)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11584 (setq xref (substring xref (match-end 0))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11585 (setq new-xref (concat xref " " new-xref)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11586 (setq new-xref (concat (system-name) " " new-xref)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11587 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11588 (set-buffer copy-buf)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11589 (gnus-request-article-this-buffer article gnus-newsgroup-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11590 (nnheader-replace-header "xref" new-xref)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11591 (gnus-request-accept-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11592 to-newsgroup select-method (not articles)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11593 (if (not art-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11594 (gnus-message 1 "Couldn't %s article %s"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11595 (cadr (assq action names)) article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11596 (let* ((entry
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11597 (or
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11598 (gnus-gethash (car art-group) gnus-newsrc-hashtb)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11599 (gnus-gethash
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11600 (gnus-group-prefixed-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11601 (car art-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11602 (or select-method
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11603 (gnus-find-method-for-group to-newsgroup)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11604 gnus-newsrc-hashtb)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11605 (info (nth 2 entry))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11606 (to-group (gnus-info-group info)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11607 ;; Update the group that has been moved to.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11608 (when (and info
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11609 (memq action '(move copy)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11610 (unless (member to-group to-groups)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11611 (push to-group to-groups))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11612
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11613 (unless (memq article gnus-newsgroup-unreads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11614 (gnus-info-set-read
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11615 info (gnus-add-to-range (gnus-info-read info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11616 (list (cdr art-group)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11617
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11618 ;; Copy any marks over to the new group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11619 (let ((marks gnus-article-mark-lists)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11620 (to-article (cdr art-group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11621
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11622 ;; See whether the article is to be put in the cache.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11623 (when gnus-use-cache
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11624 (gnus-cache-possibly-enter-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11625 to-group to-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11626 (let ((header (copy-sequence
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11627 (gnus-summary-article-header article))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11628 (mail-header-set-number header to-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11629 header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11630 (memq article gnus-newsgroup-marked)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11631 (memq article gnus-newsgroup-dormant)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11632 (memq article gnus-newsgroup-unreads)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11633
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11634 (while marks
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11635 (when (memq article (symbol-value
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11636 (intern (format "gnus-newsgroup-%s"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11637 (caar marks)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11638 ;; If the other group is the same as this group,
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11639 ;; then we have to add the mark to the list.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11640 (when (equal to-group gnus-newsgroup-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11641 (set (intern (format "gnus-newsgroup-%s" (caar marks)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11642 (cons to-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11643 (symbol-value
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11644 (intern (format "gnus-newsgroup-%s"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11645 (caar marks)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11646 ;; Copy mark to other group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11647 (gnus-add-marked-articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11648 to-group (cdar marks) (list to-article) info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11649 (setq marks (cdr marks)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11650
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11651 ;; Update the Xref header in this article to point to
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11652 ;; the new crossposted article we have just created.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11653 (when (eq action 'crosspost)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11654 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11655 (set-buffer copy-buf)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11656 (gnus-request-article-this-buffer article gnus-newsgroup-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11657 (nnheader-replace-header
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11658 "xref" (concat new-xref " " (gnus-group-prefixed-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11659 (car art-group) to-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11660 ":" (cdr art-group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11661 (gnus-request-replace-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11662 article gnus-newsgroup-name (current-buffer)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11663
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11664 (gnus-summary-goto-subject article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11665 (when (eq action 'move)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11666 (gnus-summary-mark-article article gnus-canceled-mark)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11667 (gnus-summary-remove-process-mark article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11668 ;; Re-activate all groups that have been moved to.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11669 (while to-groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11670 (gnus-activate-group (pop to-groups)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11671
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11672 (gnus-kill-buffer copy-buf)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11673 (gnus-summary-position-point)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11674 (gnus-set-mode-line 'summary)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11675
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11676 (defun gnus-summary-copy-article (&optional n to-newsgroup select-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11677 "Move the current article to a different newsgroup.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11678 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
11679 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
11680 re-spool using this method."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11681 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11682 (gnus-summary-move-article n nil select-method 'copy))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11683
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11684 (defun gnus-summary-crosspost-article (&optional n)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11685 "Crosspost the current article to some other group."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11686 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11687 (gnus-summary-move-article n nil nil 'crosspost))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11688
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11689 (defvar gnus-summary-respool-default-method nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11690 "Default method for respooling an article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11691 If nil, use to the current newsgroup method.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11692
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11693 (defun gnus-summary-respool-article (&optional n method)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11694 "Respool the current article.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11695 The article will be squeezed through the mail spooling process again,
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11696 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
11697 depending on `nnmail-split-methods'.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11698 If N is a positive number, respool the N next articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11699 If N is a negative number, respool the N previous articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11700 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
11701 respool those articles instead.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11702
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11703 Respooling can be done both from mail groups and \"real\" newsgroups.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11704 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
11705 current group into whatever groups they are destined to. In the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11706 latter case, they will be copied into the relevant groups."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11707 (interactive
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11708 (list current-prefix-arg
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11709 (let* ((methods (gnus-methods-using 'respool))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11710 (methname
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11711 (symbol-name (or gnus-summary-respool-default-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11712 (car (gnus-find-method-for-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11713 gnus-newsgroup-name)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11714 (method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11715 (gnus-completing-read
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11716 methname "What backend do you want to use when respooling?"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11717 methods nil t nil 'gnus-method-history))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11718 ms)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11719 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11720 ((zerop (length (setq ms (gnus-servers-using-backend method))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11721 (list (intern method) ""))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11722 ((= 1 (length ms))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11723 (car ms))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11724 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11725 (cdr (completing-read
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11726 "Server name: "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11727 (mapcar (lambda (m) (cons (cadr m) m)) ms) nil t)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11728 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11729 (unless method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11730 (error "No method given for respooling"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11731 (if (assoc (symbol-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11732 (car (gnus-find-method-for-group gnus-newsgroup-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11733 (gnus-methods-using 'respool))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11734 (gnus-summary-move-article n nil method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11735 (gnus-summary-copy-article n nil method)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11736
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11737 (defun gnus-summary-import-article (file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11738 "Import a random file into a mail newsgroup."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11739 (interactive "fImport file: ")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11740 (gnus-set-global-variables)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11741 (let ((group gnus-newsgroup-name)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11742 (now (current-time))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11743 atts lines)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11744 (or (gnus-check-backend-function 'request-accept-article group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11745 (error "%s does not support article importing" group))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11746 (or (file-readable-p file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11747 (not (file-regular-p file))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11748 (error "Can't read %s" file))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11749 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11750 (set-buffer (get-buffer-create " *import file*"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11751 (buffer-disable-undo (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11752 (erase-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11753 (insert-file-contents file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11754 (goto-char (point-min))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11755 (unless (nnheader-article-p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11756 ;; 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
11757 (setq atts (file-attributes file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11758 lines (count-lines (point-min) (point-max)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11759 (insert "From: " (read-string "From: ") "\n"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11760 "Subject: " (read-string "Subject: ") "\n"
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11761 "Date: " (timezone-make-date-arpa-standard
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11762 (current-time-string (nth 5 atts))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11763 (current-time-zone now)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11764 (current-time-zone now)) "\n"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11765 "Message-ID: " (message-make-message-id) "\n"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11766 "Lines: " (int-to-string lines) "\n"
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11767 "Chars: " (int-to-string (nth 7 atts)) "\n\n"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11768 (gnus-request-accept-article group nil t)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11769 (kill-buffer (current-buffer)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11770
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11771 (defun gnus-summary-expire-articles (&optional now)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11772 "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
11773 (interactive)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11774 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11775 (when (gnus-check-backend-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11776 'request-expire-articles gnus-newsgroup-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11777 ;; This backend supports expiry.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11778 (let* ((total (gnus-group-total-expirable-p gnus-newsgroup-name))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11779 (expirable (if total
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11780 (gnus-list-of-read-articles gnus-newsgroup-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11781 (setq gnus-newsgroup-expirable
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11782 (sort gnus-newsgroup-expirable '<))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11783 (expiry-wait (if now 'immediate
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11784 (gnus-group-get-parameter
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11785 gnus-newsgroup-name 'expiry-wait)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11786 es)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11787 (when expirable
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11788 ;; There are expirable articles in this group, so we run them
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11789 ;; through the expiry process.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11790 (gnus-message 6 "Expiring articles...")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11791 ;; The list of articles that weren't expired is returned.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11792 (if expiry-wait
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11793 (let ((nnmail-expiry-wait-function nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11794 (nnmail-expiry-wait expiry-wait))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11795 (setq es (gnus-request-expire-articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11796 expirable gnus-newsgroup-name)))
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)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11799 (or total (setq gnus-newsgroup-expirable es))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11800 ;; 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
11801 ;; really expired articles as nonexistent.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11802 (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
11803 (let ((gnus-use-cache nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11804 (while expirable
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11805 (unless (memq (car expirable) es)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11806 (when (gnus-data-find (car expirable))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11807 (gnus-summary-mark-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11808 (car expirable) gnus-canceled-mark)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11809 (setq expirable (cdr expirable)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11810 (gnus-message 6 "Expiring articles...done")))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11811
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11812 (defun gnus-summary-expire-articles-now ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11813 "Expunge all expirable articles in the current group.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11814 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
11815 deleted forever, right now."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11816 (interactive)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11817 (gnus-set-global-variables)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11818 (or gnus-expert-user
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11819 (gnus-y-or-n-p
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11820 "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
11821 (error "Phew!"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11822 (gnus-summary-expire-articles t))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11823
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11824 ;; Suggested by Jack Vinson <vinson@unagi.cis.upenn.edu>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11825 (defun gnus-summary-delete-article (&optional n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11826 "Delete the N next (mail) articles.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11827 This command actually deletes articles. This is not a marking
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11828 command. The article will disappear forever from your life, never to
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11829 return.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11830 If N is negative, delete backwards.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11831 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
11832 delete these instead."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11833 (interactive "P")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11834 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11835 (or (gnus-check-backend-function 'request-expire-articles
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11836 gnus-newsgroup-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11837 (error "The current newsgroup does not support article deletion."))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11838 ;; Compute the list of articles to delete.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11839 (let ((articles (gnus-summary-work-articles n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11840 not-deleted)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11841 (if (and gnus-novice-user
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11842 (not (gnus-y-or-n-p
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11843 (format "Do you really want to delete %s forever? "
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11844 (if (> (length articles) 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11845 (format "these %s articles" (length articles))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11846 "this article")))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11847 ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11848 ;; Delete the articles.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11849 (setq not-deleted (gnus-request-expire-articles
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11850 articles gnus-newsgroup-name 'force))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11851 (while articles
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11852 (gnus-summary-remove-process-mark (car articles))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11853 ;; 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
11854 ;; after all.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11855 (or (memq (car articles) not-deleted)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11856 (gnus-summary-mark-article (car articles) gnus-canceled-mark))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11857 (setq articles (cdr articles))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11858 (gnus-summary-position-point)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11859 (gnus-set-mode-line 'summary)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11860 not-deleted))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11861
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11862 (defun gnus-summary-edit-article (&optional force)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11863 "Enter into a buffer and edit the current article.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11864 This will have permanent effect only in mail groups.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11865 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
11866 groups."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11867 (interactive "P")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11868 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11869 (set-buffer gnus-summary-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11870 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11871 (when (and (not force)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11872 (gnus-group-read-only-p))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11873 (error "The current newsgroup does not support article editing."))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11874 (gnus-summary-select-article t nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11875 (gnus-configure-windows 'article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11876 (select-window (get-buffer-window gnus-article-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11877 (gnus-message 6 "C-c C-c to end edits")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11878 (setq buffer-read-only nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11879 (text-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11880 (use-local-map (copy-keymap (current-local-map)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11881 (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
11882 (buffer-enable-undo)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11883 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11884 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11885 (search-forward "\n\n" nil t)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11886
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11887 (defun gnus-summary-edit-article-done ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11888 "Make edits to the current article permanent."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11889 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11890 (if (gnus-group-read-only-p)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11891 (progn
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
11892 (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
11893 (gnus-summary-edit-article-postpone)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
11894 (when beep
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
11895 (gnus-error
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
11896 3 "The current newsgroup does not support article editing."))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11897 (let ((buf (format "%s" (buffer-string))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11898 (erase-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11899 (insert buf)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11900 (if (not (gnus-request-replace-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11901 (cdr gnus-article-current) (car gnus-article-current)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11902 (current-buffer)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11903 (error "Couldn't replace article.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11904 (gnus-article-mode)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11905 (use-local-map gnus-article-mode-map)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11906 (setq buffer-read-only t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11907 (buffer-disable-undo (current-buffer))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11908 (gnus-configure-windows 'summary)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11909 (gnus-summary-update-article (cdr gnus-article-current))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11910 (when gnus-use-cache
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11911 (gnus-cache-update-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11912 (car gnus-article-current) (cdr gnus-article-current)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11913 (when gnus-keep-backlog
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11914 (gnus-backlog-remove-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11915 (car gnus-article-current) (cdr gnus-article-current))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11916 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11917 (when (get-buffer gnus-original-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11918 (set-buffer gnus-original-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11919 (setq gnus-original-article nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11920 (setq gnus-article-current nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11921 gnus-current-article nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11922 (run-hooks 'gnus-article-display-hook)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11923 (and (gnus-visual-p 'summary-highlight 'highlight)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11924 (run-hooks 'gnus-visual-mark-article-hook)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11925
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11926 (defun gnus-summary-edit-article-postpone ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11927 "Postpone changes to the current article."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11928 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11929 (gnus-article-mode)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11930 (use-local-map gnus-article-mode-map)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11931 (setq buffer-read-only t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11932 (buffer-disable-undo (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11933 (gnus-configure-windows 'summary)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11934 (and (gnus-visual-p 'summary-highlight 'highlight)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11935 (run-hooks 'gnus-visual-mark-article-hook)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11936
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11937 (defun gnus-summary-respool-query ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11938 "Query where the respool algorithm would put this article."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11939 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11940 (gnus-set-global-variables)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11941 (gnus-summary-select-article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11942 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11943 (set-buffer gnus-article-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11944 (save-restriction
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11945 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11946 (search-forward "\n\n")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11947 (narrow-to-region (point-min) (point))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11948 (pp-eval-expression
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11949 (list 'quote (mapcar 'car (nnmail-article-group 'identity)))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11950
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11951 ;; Summary marking commands.
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 (defun gnus-summary-kill-same-subject-and-select (&optional unmark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11954 "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
11955 If UNMARK is positive, remove any kind of mark.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11956 If UNMARK is negative, tick articles."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11957 (interactive "P")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11958 (gnus-set-global-variables)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11959 (if unmark
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11960 (setq unmark (prefix-numeric-value unmark)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11961 (let ((count
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11962 (gnus-summary-mark-same-subject
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11963 (gnus-summary-article-subject) unmark)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11964 ;; Select next unread article. If auto-select-same mode, should
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11965 ;; select the first unread article.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11966 (gnus-summary-next-article t (and gnus-auto-select-same
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11967 (gnus-summary-article-subject)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11968 (gnus-message 7 "%d article%s marked as %s"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11969 count (if (= count 1) " is" "s are")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11970 (if unmark "unread" "read"))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11971
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11972 (defun gnus-summary-kill-same-subject (&optional unmark)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11973 "Mark articles which has the same subject as read.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11974 If UNMARK is positive, remove any kind of mark.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11975 If UNMARK is negative, tick articles."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11976 (interactive "P")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11977 (gnus-set-global-variables)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11978 (if unmark
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11979 (setq unmark (prefix-numeric-value unmark)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11980 (let ((count
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11981 (gnus-summary-mark-same-subject
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11982 (gnus-summary-article-subject) unmark)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11983 ;; If marked as read, go to next unread subject.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11984 (if (null unmark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11985 ;; Go to next unread subject.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11986 (gnus-summary-next-subject 1 t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11987 (gnus-message 7 "%d articles are marked as %s"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11988 count (if unmark "unread" "read"))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11989
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11990 (defun gnus-summary-mark-same-subject (subject &optional unmark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11991 "Mark articles with same SUBJECT as read, and return marked number.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11992 If optional argument UNMARK is positive, remove any kinds of marks.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11993 If optional argument UNMARK is negative, mark articles as unread instead."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11994 (let ((count 1))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11995 (save-excursion
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11996 (cond
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11997 ((null unmark) ; Mark as read.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11998 (while (and
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11999 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12000 (gnus-summary-mark-article-as-read gnus-killed-mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12001 (gnus-summary-show-thread) t)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12002 (gnus-summary-find-subject subject))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12003 (setq count (1+ count))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12004 ((> unmark 0) ; Tick.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12005 (while (and
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12006 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12007 (gnus-summary-mark-article-as-unread gnus-ticked-mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12008 (gnus-summary-show-thread) t)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12009 (gnus-summary-find-subject subject))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12010 (setq count (1+ count))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12011 (t ; Mark as unread.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12012 (while (and
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12013 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12014 (gnus-summary-mark-article-as-unread gnus-unread-mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12015 (gnus-summary-show-thread) t)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12016 (gnus-summary-find-subject subject))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12017 (setq count (1+ count)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12018 (gnus-set-mode-line 'summary)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12019 ;; Return the number of marked articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12020 count)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12021
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12022 (defun gnus-summary-mark-as-processable (n &optional unmark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12023 "Set the process mark on the next N articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12024 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
12025 the process mark instead. The difference between N and the actual
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12026 number of articles marked is returned."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12027 (interactive "p")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12028 (gnus-set-global-variables)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12029 (let ((backward (< n 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12030 (n (abs n)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12031 (while (and
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12032 (> n 0)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12033 (if unmark
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12034 (gnus-summary-remove-process-mark
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12035 (gnus-summary-article-number))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12036 (gnus-summary-set-process-mark (gnus-summary-article-number)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12037 (zerop (gnus-summary-next-subject (if backward -1 1) nil t)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12038 (setq n (1- n)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12039 (if (/= 0 n) (gnus-message 7 "No more articles"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12040 (gnus-summary-recenter)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12041 (gnus-summary-position-point)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12042 n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12043
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12044 (defun gnus-summary-unmark-as-processable (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12045 "Remove the process mark from the next N articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12046 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
12047 the actual number of articles marked is returned."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12048 (interactive "p")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12049 (gnus-set-global-variables)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12050 (gnus-summary-mark-as-processable n t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12051
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12052 (defun gnus-summary-unmark-all-processable ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12053 "Remove the process mark from all articles."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12054 (interactive)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12055 (gnus-set-global-variables)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12056 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12057 (while gnus-newsgroup-processable
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12058 (gnus-summary-remove-process-mark (car gnus-newsgroup-processable))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12059 (gnus-summary-position-point))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12060
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12061 (defun gnus-summary-mark-as-expirable (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12062 "Mark N articles forward as expirable.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12063 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
12064 the actual number of articles marked is returned."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12065 (interactive "p")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12066 (gnus-set-global-variables)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12067 (gnus-summary-mark-forward n gnus-expirable-mark))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12068
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12069 (defun gnus-summary-mark-article-as-replied (article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12070 "Mark ARTICLE replied and update the summary line."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12071 (setq gnus-newsgroup-replied (cons article gnus-newsgroup-replied))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12072 (let ((buffer-read-only nil))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12073 (when (gnus-summary-goto-subject article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12074 (gnus-summary-update-secondary-mark article))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12075
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12076 (defun gnus-summary-set-bookmark (article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12077 "Set a bookmark in current article."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12078 (interactive (list (gnus-summary-article-number)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12079 (gnus-set-global-variables)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12080 (if (or (not (get-buffer gnus-article-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12081 (not gnus-current-article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12082 (not gnus-article-current)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12083 (not (equal gnus-newsgroup-name (car gnus-article-current))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12084 (error "No current article selected"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12085 ;; Remove old bookmark, if one exists.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12086 (let ((old (assq article gnus-newsgroup-bookmarks)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12087 (if old (setq gnus-newsgroup-bookmarks
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12088 (delq old gnus-newsgroup-bookmarks))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12089 ;; Set the new bookmark, which is on the form
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12090 ;; (article-number . line-number-in-body).
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12091 (setq gnus-newsgroup-bookmarks
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12092 (cons
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12093 (cons article
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12094 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12095 (set-buffer gnus-article-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12096 (count-lines
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12097 (min (point)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12098 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12099 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12100 (search-forward "\n\n" nil t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12101 (point)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12102 (point))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12103 gnus-newsgroup-bookmarks))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12104 (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
12105
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12106 (defun gnus-summary-remove-bookmark (article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12107 "Remove the bookmark from the current article."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12108 (interactive (list (gnus-summary-article-number)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12109 (gnus-set-global-variables)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12110 ;; Remove old bookmark, if one exists.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12111 (let ((old (assq article gnus-newsgroup-bookmarks)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12112 (if old
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12113 (progn
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12114 (setq gnus-newsgroup-bookmarks
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12115 (delq old gnus-newsgroup-bookmarks))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12116 (gnus-message 6 "Removed bookmark."))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12117 (gnus-message 6 "No bookmark in current article."))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12118
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12119 ;; Suggested by Daniel Quinlan <quinlan@best.com>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12120 (defun gnus-summary-mark-as-dormant (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12121 "Mark N articles forward as dormant.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12122 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
12123 the actual number of articles marked is returned."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12124 (interactive "p")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12125 (gnus-set-global-variables)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12126 (gnus-summary-mark-forward n gnus-dormant-mark))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12127
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12128 (defun gnus-summary-set-process-mark (article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12129 "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
12130 (setq gnus-newsgroup-processable
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12131 (cons article
13694
73433c3071a5 * gnus.el (gnus-parse-headers-hook): New hook.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 13579
diff changeset
12132 (delq article gnus-newsgroup-processable)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12133 (when (gnus-summary-goto-subject article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12134 (gnus-summary-show-thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12135 (gnus-summary-update-secondary-mark article)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12136
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12137 (defun gnus-summary-remove-process-mark (article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12138 "Remove the process mark from ARTICLE and update the summary line."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12139 (setq gnus-newsgroup-processable (delq article gnus-newsgroup-processable))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12140 (when (gnus-summary-goto-subject article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12141 (gnus-summary-show-thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12142 (gnus-summary-update-secondary-mark article)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12143
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12144 (defun gnus-summary-set-saved-mark (article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12145 "Set the process mark on ARTICLE and update the summary line."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12146 (push article gnus-newsgroup-saved)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12147 (when (gnus-summary-goto-subject article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12148 (gnus-summary-update-secondary-mark article)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12149
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12150 (defun gnus-summary-mark-forward (n &optional mark no-expire)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12151 "Mark N articles as read forwards.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12152 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
12153 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
12154 returned."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12155 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12156 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12157 (let ((backward (< n 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12158 (gnus-summary-goto-unread
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12159 (and gnus-summary-goto-unread
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12160 (not (eq gnus-summary-goto-unread 'never))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12161 (not (memq mark (list gnus-unread-mark
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12162 gnus-ticked-mark gnus-dormant-mark)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12163 (n (abs n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12164 (mark (or mark gnus-del-mark)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12165 (while (and (> n 0)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12166 (gnus-summary-mark-article nil mark no-expire)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12167 (zerop (gnus-summary-next-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12168 (if backward -1 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12169 (and gnus-summary-goto-unread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12170 (not (eq gnus-summary-goto-unread 'never)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12171 t)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12172 (setq n (1- n)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12173 (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
12174 (gnus-summary-recenter)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12175 (gnus-summary-position-point)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12176 (gnus-set-mode-line 'summary)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12177 n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12178
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12179 (defun gnus-summary-mark-article-as-read (mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12180 "Mark the current article quickly as read with MARK."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12181 (let ((article (gnus-summary-article-number)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12182 (setq gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12183 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12184 (setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12185 (setq gnus-newsgroup-reads
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12186 (cons (cons article mark) gnus-newsgroup-reads))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12187 ;; Possibly remove from cache, if that is used.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12188 (and gnus-use-cache (gnus-cache-enter-remove-article article))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12189 ;; Allow the backend to change the mark.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12190 (setq mark (gnus-request-update-mark gnus-newsgroup-name article mark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12191 ;; Check for auto-expiry.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12192 (when (and gnus-newsgroup-auto-expire
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12193 (or (= mark gnus-killed-mark) (= mark gnus-del-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12194 (= mark gnus-catchup-mark) (= mark gnus-low-score-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12195 (= mark gnus-ancient-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12196 (= mark gnus-read-mark) (= mark gnus-souped-mark)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12197 (setq mark gnus-expirable-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12198 (push article gnus-newsgroup-expirable))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12199 ;; Set the mark in the buffer.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12200 (gnus-summary-update-mark mark 'unread)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12201 t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12202
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12203 (defun gnus-summary-mark-article-as-unread (mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12204 "Mark the current article quickly as unread with MARK."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12205 (let ((article (gnus-summary-article-number)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12206 (if (< article 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12207 (gnus-error 1 "Unmarkable article")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12208 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12209 (setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12210 (setq gnus-newsgroup-expirable (delq article gnus-newsgroup-expirable))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12211 (setq gnus-newsgroup-reads (delq article gnus-newsgroup-reads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12212 (cond ((= mark gnus-ticked-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12213 (push article gnus-newsgroup-marked))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12214 ((= mark gnus-dormant-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12215 (push article gnus-newsgroup-dormant))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12216 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12217 (push article gnus-newsgroup-unreads)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12218 (setq gnus-newsgroup-reads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12219 (delq (assq article gnus-newsgroup-reads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12220 gnus-newsgroup-reads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12221
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12222 ;; See whether the article is to be put in the cache.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12223 (and gnus-use-cache
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12224 (vectorp (gnus-summary-article-header article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12225 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12226 (gnus-cache-possibly-enter-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12227 gnus-newsgroup-name article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12228 (gnus-summary-article-header article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12229 (= mark gnus-ticked-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12230 (= mark gnus-dormant-mark) (= mark gnus-unread-mark))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12231
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12232 ;; Fix the mark.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12233 (gnus-summary-update-mark mark 'unread))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12234 t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12235
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12236 (defun gnus-summary-mark-article (&optional article mark no-expire)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12237 "Mark ARTICLE with MARK. MARK can be any character.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12238 Four MARK strings are reserved: `? ' (unread), `?!' (ticked),
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12239 `??' (dormant) and `?E' (expirable).
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12240 If MARK is nil, then the default character `?D' is used.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12241 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
12242 marked."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12243 ;; The mark might be a string.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12244 (and (stringp mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12245 (setq mark (aref mark 0)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12246 ;; If no mark is given, then we check auto-expiring.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12247 (and (not no-expire)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12248 gnus-newsgroup-auto-expire
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12249 (or (not mark)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12250 (and (numberp mark)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12251 (or (= mark gnus-killed-mark) (= mark gnus-del-mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12252 (= mark gnus-catchup-mark) (= mark gnus-low-score-mark)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12253 (= mark gnus-read-mark) (= mark gnus-souped-mark))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12254 (setq mark gnus-expirable-mark))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12255 (let* ((mark (or mark gnus-del-mark))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12256 (article (or article (gnus-summary-article-number))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12257 (or article (error "No article on current line"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12258 (if (or (= mark gnus-unread-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12259 (= mark gnus-ticked-mark)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12260 (= mark gnus-dormant-mark))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12261 (gnus-mark-article-as-unread article mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12262 (gnus-mark-article-as-read article mark))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12263
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12264 ;; See whether the article is to be put in the cache.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12265 (and gnus-use-cache
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12266 (not (= mark gnus-canceled-mark))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12267 (vectorp (gnus-summary-article-header article))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12268 (save-excursion
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12269 (gnus-cache-possibly-enter-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12270 gnus-newsgroup-name article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12271 (gnus-summary-article-header article)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12272 (= mark gnus-ticked-mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12273 (= mark gnus-dormant-mark) (= mark gnus-unread-mark))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12274
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12275 (if (gnus-summary-goto-subject article nil t)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12276 (let ((buffer-read-only nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12277 (gnus-summary-show-thread)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12278 ;; Fix the mark.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12279 (gnus-summary-update-mark mark 'unread)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12280 t))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12281
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12282 (defun gnus-summary-update-secondary-mark (article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12283 "Update the secondary (read, process, cache) mark."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12284 (gnus-summary-update-mark
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12285 (cond ((memq article gnus-newsgroup-processable)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12286 gnus-process-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12287 ((memq article gnus-newsgroup-cached)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12288 gnus-cached-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12289 ((memq article gnus-newsgroup-replied)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12290 gnus-replied-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12291 ((memq article gnus-newsgroup-saved)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12292 gnus-saved-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12293 (t gnus-unread-mark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12294 'replied)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12295 (when (gnus-visual-p 'summary-highlight 'highlight)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12296 (run-hooks 'gnus-summary-update-hook))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12297 t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12298
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12299 (defun gnus-summary-update-mark (mark type)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12300 (beginning-of-line)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12301 (let ((forward (cdr (assq type gnus-summary-mark-positions)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12302 (buffer-read-only nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12303 (when (and forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12304 (<= (+ forward (point)) (point-max)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12305 ;; Go to the right position on the line.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12306 (goto-char (+ forward (point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12307 ;; Replace the old mark with the new mark.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12308 (subst-char-in-region (point) (1+ (point)) (following-char) mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12309 ;; Optionally update the marks by some user rule.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12310 (when (eq type 'unread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12311 (gnus-data-set-mark
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12312 (gnus-data-find (gnus-summary-article-number)) mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12313 (gnus-summary-update-line (eq mark gnus-unread-mark))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12314
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12315 (defun gnus-mark-article-as-read (article &optional mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12316 "Enter ARTICLE in the pertinent lists and remove it from others."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12317 ;; Make the article expirable.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12318 (let ((mark (or mark gnus-del-mark)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12319 (if (= mark gnus-expirable-mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12320 (setq gnus-newsgroup-expirable (cons article gnus-newsgroup-expirable))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12321 (setq gnus-newsgroup-expirable (delq article gnus-newsgroup-expirable)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12322 ;; Remove from unread and marked lists.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12323 (setq gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12324 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12325 (setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12326 (push (cons article mark) gnus-newsgroup-reads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12327 ;; Possibly remove from cache, if that is used.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12328 (when gnus-use-cache
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12329 (gnus-cache-enter-remove-article article))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12330
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12331 (defun gnus-mark-article-as-unread (article &optional mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12332 "Enter ARTICLE in the pertinent lists and remove it from others."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12333 (let ((mark (or mark gnus-ticked-mark)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12334 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12335 (setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12336 (setq gnus-newsgroup-expirable (delq article gnus-newsgroup-expirable))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12337 (setq gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12338 (cond ((= mark gnus-ticked-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12339 (push article gnus-newsgroup-marked))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12340 ((= mark gnus-dormant-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12341 (push article gnus-newsgroup-dormant))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12342 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12343 (push article gnus-newsgroup-unreads)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12344 (setq gnus-newsgroup-reads
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12345 (delq (assq article gnus-newsgroup-reads)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12346 gnus-newsgroup-reads))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12347
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12348 (defalias 'gnus-summary-mark-as-unread-forward
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12349 'gnus-summary-tick-article-forward)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12350 (make-obsolete '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)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12352 (defun gnus-summary-tick-article-forward (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12353 "Tick N articles forwards.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12354 If N is negative, tick backwards instead.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12355 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
12356 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12357 (gnus-summary-mark-forward n gnus-ticked-mark))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12358
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12359 (defalias 'gnus-summary-mark-as-unread-backward
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12360 'gnus-summary-tick-article-backward)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12361 (make-obsolete '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)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12363 (defun gnus-summary-tick-article-backward (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12364 "Tick N articles backwards.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12365 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
12366 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12367 (gnus-summary-mark-forward (- n) gnus-ticked-mark))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12368
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12369 (defalias 'gnus-summary-mark-as-unread 'gnus-summary-tick-article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12370 (make-obsolete 'gnus-summary-mark-as-unread 'gnus-summary-tick-article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12371 (defun gnus-summary-tick-article (&optional article clear-mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12372 "Mark current article as unread.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12373 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
12374 Optional 2nd argument CLEAR-MARK remove any kinds of mark."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12375 (interactive)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12376 (gnus-summary-mark-article article (if clear-mark gnus-unread-mark
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12377 gnus-ticked-mark)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12378
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12379 (defun gnus-summary-mark-as-read-forward (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12380 "Mark N articles as read forwards.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12381 If N is negative, mark backwards instead.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12382 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
12383 returned."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12384 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12385 (gnus-summary-mark-forward n gnus-del-mark t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12386
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12387 (defun gnus-summary-mark-as-read-backward (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12388 "Mark the N articles as read backwards.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12389 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
12390 returned."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12391 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12392 (gnus-summary-mark-forward (- n) gnus-del-mark t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12393
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12394 (defun gnus-summary-mark-as-read (&optional article mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12395 "Mark current article as read.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12396 ARTICLE specifies the article to be marked as read.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12397 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
12398 (gnus-summary-mark-article article mark))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12399
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12400 (defun gnus-summary-clear-mark-forward (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12401 "Clear marks from N articles forward.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12402 If N is negative, clear backward instead.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12403 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
12404 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12405 (gnus-summary-mark-forward n gnus-unread-mark))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12406
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12407 (defun gnus-summary-clear-mark-backward (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12408 "Clear marks from N articles backward.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12409 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
12410 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12411 (gnus-summary-mark-forward (- n) gnus-unread-mark))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12412
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12413 (defun gnus-summary-mark-unread-as-read ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12414 "Intended to be used by `gnus-summary-mark-article-hook'."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12415 (when (memq gnus-current-article gnus-newsgroup-unreads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12416 (gnus-summary-mark-article gnus-current-article gnus-read-mark)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12417
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12418 (defun gnus-summary-mark-read-and-unread-as-read ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12419 "Intended to be used by `gnus-summary-mark-article-hook'."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12420 (let ((mark (gnus-summary-article-mark)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12421 (when (or (gnus-unread-mark-p mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12422 (gnus-read-mark-p mark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12423 (gnus-summary-mark-article gnus-current-article gnus-read-mark))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12424
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12425 (defun gnus-summary-mark-region-as-read (point mark all)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12426 "Mark all unread articles between point and mark as read.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12427 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
12428 even ticked and dormant ones."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12429 (interactive "r\nP")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12430 (save-excursion
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12431 (let (article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12432 (goto-char point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12433 (beginning-of-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12434 (while (and
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12435 (< (point) mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12436 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12437 (when (or all
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12438 (memq (setq article (gnus-summary-article-number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12439 gnus-newsgroup-unreads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12440 (gnus-summary-mark-article article gnus-del-mark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12441 t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12442 (gnus-summary-find-next))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12443
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12444 (defun gnus-summary-mark-below (score mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12445 "Mark articles with score less than SCORE with MARK."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12446 (interactive "P\ncMark: ")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12447 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12448 (setq score (if score
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12449 (prefix-numeric-value score)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12450 (or gnus-summary-default-score 0)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12451 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12452 (set-buffer gnus-summary-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12453 (goto-char (point-min))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12454 (while
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12455 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12456 (and (< (gnus-summary-article-score) score)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12457 (gnus-summary-mark-article nil mark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12458 (gnus-summary-find-next)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12459
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12460 (defun gnus-summary-kill-below (&optional score)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12461 "Mark articles with score below SCORE as read."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12462 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12463 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12464 (gnus-summary-mark-below score gnus-killed-mark))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12465
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12466 (defun gnus-summary-clear-above (&optional score)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12467 "Clear all marks from articles with score above SCORE."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12468 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12469 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12470 (gnus-summary-mark-above score gnus-unread-mark))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12471
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12472 (defun gnus-summary-tick-above (&optional score)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12473 "Tick all articles with score above SCORE."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12474 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12475 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12476 (gnus-summary-mark-above score gnus-ticked-mark))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12477
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12478 (defun gnus-summary-mark-above (score mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12479 "Mark articles with score over SCORE with MARK."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12480 (interactive "P\ncMark: ")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12481 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12482 (setq score (if score
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12483 (prefix-numeric-value score)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12484 (or gnus-summary-default-score 0)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12485 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12486 (set-buffer gnus-summary-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12487 (goto-char (point-min))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12488 (while (and (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12489 (if (> (gnus-summary-article-score) score)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12490 (gnus-summary-mark-article nil mark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12491 t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12492 (gnus-summary-find-next)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12493
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12494 ;; Suggested by Daniel Quinlan <quinlan@best.com>.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12495 (defalias 'gnus-summary-show-all-expunged 'gnus-summary-limit-include-expunged)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12496 (defun gnus-summary-limit-include-expunged ()
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12497 "Display all the hidden articles that were expunged for low scores."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12498 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12499 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12500 (let ((buffer-read-only nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12501 (let ((scored gnus-newsgroup-scored)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12502 headers h)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12503 (while scored
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12504 (or (gnus-summary-goto-subject (caar scored))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12505 (and (setq h (gnus-summary-article-header (caar scored)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12506 (< (cdar scored) gnus-summary-expunge-below)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12507 (setq headers (cons h headers))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12508 (setq scored (cdr scored)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12509 (or headers (error "No expunged articles hidden."))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12510 (goto-char (point-min))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12511 (gnus-summary-prepare-unthreaded (nreverse headers)))
13401
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-position-point)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12514
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12515 (defun gnus-summary-catchup (&optional all quietly to-here not-mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12516 "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
12517 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
12518 If QUIETLY is non-nil, no questions will be asked.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12519 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
12520 articles before this point will be marked as read.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12521 The number of articles marked as read is returned."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12522 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12523 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12524 (prog1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12525 (if (or quietly
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12526 (not gnus-interactive-catchup) ;Without confirmation?
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12527 gnus-expert-user
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12528 (gnus-y-or-n-p
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12529 (if all
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12530 "Mark absolutely all articles as read? "
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12531 "Mark all unread articles as read? ")))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12532 (if (and not-mark
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12533 (not gnus-newsgroup-adaptive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12534 (not gnus-newsgroup-auto-expire))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12535 (progn
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12536 (when all
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12537 (setq gnus-newsgroup-marked nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12538 gnus-newsgroup-dormant nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12539 (setq gnus-newsgroup-unreads nil))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12540 ;; We actually mark all articles as canceled, which we
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12541 ;; have to do when using auto-expiry or adaptive scoring.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12542 (gnus-summary-show-all-threads)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12543 (if (gnus-summary-first-subject (not all))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12544 (while (and
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12545 (if to-here (< (point) to-here) t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12546 (gnus-summary-mark-article-as-read gnus-catchup-mark)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12547 (gnus-summary-find-next (not all)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12548 (unless to-here
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12549 (setq gnus-newsgroup-unreads nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12550 (gnus-set-mode-line 'summary)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12551 (let ((method (gnus-find-method-for-group gnus-newsgroup-name)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12552 (if (and (not to-here) (eq 'nnvirtual (car method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12553 (nnvirtual-catchup-group
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12554 (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
12555 (gnus-summary-position-point)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12556
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12557 (defun gnus-summary-catchup-to-here (&optional all)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12558 "Mark all unticked articles before the current one as read.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12559 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
12560 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12561 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12562 (save-excursion
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12563 (gnus-save-hidden-threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12564 (let ((beg (point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12565 ;; We check that there are unread articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12566 (when (or all (gnus-summary-find-prev))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12567 (gnus-summary-catchup all t beg)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12568 (gnus-summary-position-point))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12569
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12570 (defun gnus-summary-catchup-all (&optional quietly)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12571 "Mark all articles in this newsgroup as read."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12572 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12573 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12574 (gnus-summary-catchup t quietly))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12575
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12576 (defun gnus-summary-catchup-and-exit (&optional all quietly)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12577 "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
12578 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
12579 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12580 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12581 (gnus-summary-catchup all quietly nil 'fast)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12582 ;; Select next newsgroup or exit.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12583 (if (eq gnus-auto-select-next 'quietly)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12584 (gnus-summary-next-group nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12585 (gnus-summary-exit)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12586
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12587 (defun gnus-summary-catchup-all-and-exit (&optional quietly)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12588 "Mark all articles in this newsgroup as read, and then exit."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12589 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12590 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12591 (gnus-summary-catchup-and-exit t quietly))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12592
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12593 ;; Suggested by "Arne Eofsson" <arne@hodgkin.mbi.ucla.edu>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12594 (defun gnus-summary-catchup-and-goto-next-group (&optional all)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12595 "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
12596 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
12597 read."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12598 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12599 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12600 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12601 (gnus-summary-catchup all))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12602 (gnus-summary-next-article t nil nil t))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12603
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12604 ;; Thread-based commands.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12605
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12606 (defun gnus-summary-articles-in-thread (&optional article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12607 "Return a list of all articles in the current thread.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12608 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
12609 with that article."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12610 (let* ((article (or article (gnus-summary-article-number)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12611 (data (gnus-data-find-list article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12612 (top-level (gnus-data-level (car data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12613 (top-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12614 (cond ((null gnus-thread-operation-ignore-subject)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12615 (gnus-simplify-subject-re
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12616 (mail-header-subject (gnus-data-header (car data)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12617 ((eq gnus-thread-operation-ignore-subject 'fuzzy)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12618 (gnus-simplify-subject-fuzzy
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12619 (mail-header-subject (gnus-data-header (car data)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12620 (t nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12621 (end-point (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12622 (if (gnus-summary-go-to-next-thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12623 (point) (point-max))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12624 articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12625 (while (and data
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12626 (< (gnus-data-pos (car data)) end-point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12627 (when (or (not top-subject)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12628 (string= top-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12629 (if (eq gnus-thread-operation-ignore-subject 'fuzzy)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12630 (gnus-simplify-subject-fuzzy
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12631 (mail-header-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12632 (gnus-data-header (car data))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12633 (gnus-simplify-subject-re
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12634 (mail-header-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12635 (gnus-data-header (car data)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12636 (push (gnus-data-number (car data)) articles))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12637 (unless (and (setq data (cdr data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12638 (> (gnus-data-level (car data)) top-level))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12639 (setq data nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12640 ;; Return the list of articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12641 (nreverse articles)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12642
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12643 (defun gnus-summary-rethread-current ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12644 "Rethread the thread the current article is part of."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12645 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12646 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12647 (let* ((gnus-show-threads t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12648 (article (gnus-summary-article-number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12649 (id (mail-header-id (gnus-summary-article-header)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12650 (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
12651 (unless id
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12652 (error "No article on the current line"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12653 (gnus-rebuild-thread id)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12654 (gnus-summary-goto-subject article)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12655
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12656 (defun gnus-summary-reparent-thread ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12657 "Make current article child of the marked (or previous) article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12658
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12659 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
12660 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
12661 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12662 (or (not (gnus-group-read-only-p))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12663 (error "The current newsgroup does not support article editing."))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12664 (or (<= (length gnus-newsgroup-processable) 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12665 (error "No more than one article may be marked."))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12666 (save-window-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12667 (let ((gnus-article-buffer " *reparent*")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12668 (current-article (gnus-summary-article-number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12669 ; first grab the marked article, otherwise one line up.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12670 (parent-article (if (not (null gnus-newsgroup-processable))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12671 (car gnus-newsgroup-processable)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12672 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12673 (if (eq (forward-line -1) 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12674 (gnus-summary-article-number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12675 (error "Beginning of summary buffer."))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12676 (or (not (eq current-article parent-article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12677 (error "An article may not be self-referential."))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12678 (let ((message-id (mail-header-id
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12679 (gnus-summary-article-header parent-article))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12680 (or (and message-id (not (equal message-id "")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12681 (error "No message-id in desired parent."))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12682 (gnus-summary-select-article t t nil current-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12683 (set-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12684 (setq buffer-read-only nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12685 (let ((buf (format "%s" (buffer-string))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12686 (erase-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12687 (insert buf))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12688 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12689 (if (search-forward-regexp "^References: " nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12690 (insert message-id " " )
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12691 (insert "References: " message-id "\n"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12692 (or (gnus-request-replace-article current-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12693 (car gnus-article-current)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12694 gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12695 (error "Couldn't replace article."))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12696 (set-buffer gnus-summary-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12697 (gnus-summary-unmark-all-processable)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12698 (gnus-summary-rethread-current)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12699 (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
12700 current-article parent-article)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12701
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12702 (defun gnus-summary-toggle-threads (&optional arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12703 "Toggle showing conversation threads.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12704 If ARG is positive number, turn showing conversation threads on."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12705 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12706 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12707 (let ((current (or (gnus-summary-article-number) gnus-newsgroup-end)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12708 (setq gnus-show-threads
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12709 (if (null arg) (not gnus-show-threads)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12710 (> (prefix-numeric-value arg) 0)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12711 (gnus-summary-prepare)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12712 (gnus-summary-goto-subject current)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12713 (gnus-summary-position-point)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12714
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12715 (defun gnus-summary-show-all-threads ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12716 "Show all threads."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12717 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12718 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12719 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12720 (let ((buffer-read-only nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12721 (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
12722 (gnus-summary-position-point))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12723
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12724 (defun gnus-summary-show-thread ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12725 "Show thread subtrees.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12726 Returns nil if no thread was there to be shown."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12727 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12728 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12729 (let ((buffer-read-only nil)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12730 (orig (point))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12731 ;; 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
12732 (end (progn (end-of-line) (point)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12733 (beg (progn (beginning-of-line) (point))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12734 (prog1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12735 ;; Any hidden lines here?
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12736 (search-forward "\r" end t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12737 (subst-char-in-region beg end ?\^M ?\n t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12738 (goto-char orig)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12739 (gnus-summary-position-point))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12740
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12741 (defun gnus-summary-hide-all-threads ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12742 "Hide all thread subtrees."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12743 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12744 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12745 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12746 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12747 (gnus-summary-hide-thread)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12748 (while (zerop (gnus-summary-next-thread 1 t))
13401
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 (gnus-summary-position-point))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12751
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12752 (defun gnus-summary-hide-thread ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12753 "Hide thread subtrees.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12754 Returns nil if no threads were there to be hidden."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12755 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12756 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12757 (let ((buffer-read-only nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12758 (start (point))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12759 (article (gnus-summary-article-number)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12760 (goto-char start)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12761 ;; Go forward until either the buffer ends or the subthread
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12762 ;; ends.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12763 (when (and (not (eobp))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12764 (or (zerop (gnus-summary-next-thread 1 t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12765 (goto-char (point-max))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12766 (prog1
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12767 (if (and (> (point) start)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12768 (search-backward "\n" start t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12769 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12770 (subst-char-in-region start (point) ?\n ?\^M)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12771 (gnus-summary-goto-subject article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12772 (goto-char start)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12773 nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12774 ;;(gnus-summary-position-point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12775 ))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12776
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12777 (defun gnus-summary-go-to-next-thread (&optional previous)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12778 "Go to the same level (or less) next thread.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12779 If PREVIOUS is non-nil, go to previous thread instead.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12780 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
12781 (let ((level (gnus-summary-thread-level))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12782 (way (if previous -1 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12783 (beg (point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12784 (forward-line way)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12785 (while (and (not (eobp))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12786 (< level (gnus-summary-thread-level)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12787 (forward-line way))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12788 (if (eobp)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12789 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12790 (goto-char beg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12791 nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12792 (setq beg (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12793 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12794 (gnus-summary-article-number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12795 (goto-char beg)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12796
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12797 (defun gnus-summary-go-to-next-thread-old (&optional previous)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12798 "Go to the same level (or less) next thread.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12799 If PREVIOUS is non-nil, go to previous thread instead.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12800 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
12801 (if (and (eq gnus-summary-make-false-root 'dummy)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12802 (gnus-summary-article-intangible-p))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12803 (let ((beg (point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12804 (while (and (zerop (forward-line 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12805 (not (gnus-summary-article-intangible-p))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12806 (not (zerop (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12807 (gnus-summary-thread-level))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12808 (if (eobp)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12809 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12810 (goto-char beg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12811 nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12812 (point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12813 (let* ((level (gnus-summary-thread-level))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12814 (article (gnus-summary-article-number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12815 (data (cdr (gnus-data-find-list article (gnus-data-list previous))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12816 oart)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12817 (while data
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12818 (if (<= (gnus-data-level (car data)) level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12819 (setq oart (gnus-data-number (car data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12820 data nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12821 (setq data (cdr data))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12822 (and oart
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12823 (gnus-summary-goto-subject oart)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12824
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12825 (defun gnus-summary-next-thread (n &optional silent)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12826 "Go to the same level next N'th thread.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12827 If N is negative, search backward instead.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12828 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
12829 done.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12830
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12831 If SILENT, don't output messages."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12832 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12833 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12834 (let ((backward (< n 0))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12835 (n (abs n))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12836 old dum int)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12837 (while (and (> n 0)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12838 (gnus-summary-go-to-next-thread backward))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12839 (decf n))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12840 (unless silent
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12841 (gnus-summary-position-point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12842 (when (and (not silent) (/= 0 n))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12843 (gnus-message 7 "No more threads"))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12844 n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12845
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12846 (defun gnus-summary-prev-thread (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12847 "Go to the same level previous N'th thread.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12848 Returns the difference between N and the number of skips actually
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12849 done."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12850 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12851 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12852 (gnus-summary-next-thread (- n)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12853
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12854 (defun gnus-summary-go-down-thread ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12855 "Go down one level in the current thread."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12856 (let ((children (gnus-summary-article-children)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12857 (and children
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12858 (gnus-summary-goto-subject (car children)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12859
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12860 (defun gnus-summary-go-up-thread ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12861 "Go up one level in the current thread."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12862 (let ((parent (gnus-summary-article-parent)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12863 (and parent
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12864 (gnus-summary-goto-subject parent))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12865
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12866 (defun gnus-summary-down-thread (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12867 "Go down thread N steps.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12868 If N is negative, go up instead.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12869 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
12870 taken."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12871 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12872 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12873 (let ((up (< n 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12874 (n (abs n)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12875 (while (and (> n 0)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12876 (if up (gnus-summary-go-up-thread)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12877 (gnus-summary-go-down-thread)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12878 (setq n (1- n)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12879 (gnus-summary-position-point)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12880 (if (/= 0 n) (gnus-message 7 "Can't go further"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12881 n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12882
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12883 (defun gnus-summary-up-thread (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12884 "Go up thread N steps.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12885 If N is negative, go up instead.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12886 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
12887 taken."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12888 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12889 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12890 (gnus-summary-down-thread (- n)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12891
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12892 (defun gnus-summary-top-thread ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12893 "Go to the top of the thread."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12894 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12895 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12896 (while (gnus-summary-go-up-thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12897 (gnus-summary-article-number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12898
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12899 (defun gnus-summary-kill-thread (&optional unmark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12900 "Mark articles under current thread as read.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12901 If the prefix argument is positive, remove any kinds of marks.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12902 If the prefix argument is negative, tick articles instead."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12903 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12904 (gnus-set-global-variables)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12905 (when unmark
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12906 (setq unmark (prefix-numeric-value unmark)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12907 (let ((articles (gnus-summary-articles-in-thread)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12908 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12909 ;; Expand the thread.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12910 (gnus-summary-show-thread)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12911 ;; Mark all the articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12912 (while articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12913 (gnus-summary-goto-subject (car articles))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12914 (cond ((null unmark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12915 (gnus-summary-mark-article-as-read gnus-killed-mark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12916 ((> unmark 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12917 (gnus-summary-mark-article-as-unread gnus-unread-mark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12918 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12919 (gnus-summary-mark-article-as-unread gnus-ticked-mark)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12920 (setq articles (cdr articles))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12921 ;; Hide killed subtrees.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12922 (and (null unmark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12923 gnus-thread-hide-killed
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12924 (gnus-summary-hide-thread))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12925 ;; If marked as read, go to next unread subject.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12926 (if (null unmark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12927 ;; Go to next unread subject.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12928 (gnus-summary-next-subject 1 t)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12929 (gnus-set-mode-line 'summary))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12930
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12931 ;; Summary sorting commands
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 (defun gnus-summary-sort-by-number (&optional reverse)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12934 "Sort summary buffer by article number.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12935 Argument REVERSE means reverse order."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12936 (interactive "P")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12937 (gnus-summary-sort 'number reverse))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12938
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12939 (defun gnus-summary-sort-by-author (&optional reverse)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12940 "Sort summary buffer by author name alphabetically.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12941 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
12942 Argument REVERSE means reverse order."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12943 (interactive "P")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12944 (gnus-summary-sort 'author reverse))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12945
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12946 (defun gnus-summary-sort-by-subject (&optional reverse)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12947 "Sort summary buffer by subject alphabetically. `Re:'s are ignored.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12948 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
12949 Argument REVERSE means reverse order."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12950 (interactive "P")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12951 (gnus-summary-sort 'subject reverse))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12952
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12953 (defun gnus-summary-sort-by-date (&optional reverse)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12954 "Sort summary buffer by date.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12955 Argument REVERSE means reverse order."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12956 (interactive "P")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12957 (gnus-summary-sort 'date reverse))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12958
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12959 (defun gnus-summary-sort-by-score (&optional reverse)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12960 "Sort summary buffer by score.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12961 Argument REVERSE means reverse order."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12962 (interactive "P")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12963 (gnus-summary-sort 'score reverse))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12964
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12965 (defun gnus-summary-sort (predicate reverse)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12966 "Sort summary buffer by PREDICATE. REVERSE means reverse order."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12967 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12968 (let* ((thread (intern (format "gnus-thread-sort-by-%s" predicate)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12969 (article (intern (format "gnus-article-sort-by-%s" predicate)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12970 (gnus-thread-sort-functions
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12971 (list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12972 (if (not reverse)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12973 thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12974 `(lambda (t1 t2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12975 (,thread t2 t1)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12976 (gnus-article-sort-functions
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12977 (list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12978 (if (not reverse)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12979 article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12980 `(lambda (t1 t2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12981 (,article t2 t1)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12982 (buffer-read-only)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12983 (gnus-summary-prepare-hook nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12984 ;; We do the sorting by regenerating the threads.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12985 (gnus-summary-prepare)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12986 ;; Hide subthreads if needed.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12987 (when (and gnus-show-threads gnus-thread-hide-subtree)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12988 (gnus-summary-hide-all-threads)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12989 ;; If in async mode, we send some info to the backend.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12990 (when gnus-newsgroup-async
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12991 (gnus-request-asynchronous
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12992 gnus-newsgroup-name gnus-newsgroup-data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12993
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12994 (defun gnus-sortable-date (date)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12995 "Make sortable string by string-lessp from DATE.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12996 Timezone package is used."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12997 (condition-case ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12998 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12999 (setq date (inline (timezone-fix-time
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13000 date nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13001 (aref (inline (timezone-parse-date date)) 4))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13002 (inline
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13003 (timezone-make-sortable-date
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13004 (aref date 0) (aref date 1) (aref date 2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13005 (inline
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13006 (timezone-make-time-string
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13007 (aref date 3) (aref date 4) (aref date 5))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13008 (error "")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13009
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13010 ;; Summary saving commands.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13011
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13012 (defun gnus-summary-save-article (&optional n not-saved)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13013 "Save the current article using the default saver function.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13014 If N is a positive number, save the N next articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13015 If N is a negative number, save the N previous articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13016 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
13017 save those articles instead.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13018 The variable `gnus-default-article-saver' specifies the saver function."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13019 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13020 (gnus-set-global-variables)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13021 (let ((articles (gnus-summary-work-articles n))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13022 (save-buffer (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13023 (nnheader-set-temp-buffer " *Gnus Save*")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13024 file header article)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13025 (while articles
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13026 (setq header (gnus-summary-article-header
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13027 (setq article (pop articles))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13028 (if (not (vectorp header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13029 ;; This is a pseudo-article.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13030 (if (assq 'name header)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13031 (gnus-copy-file (cdr (assq 'name header)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13032 (gnus-message 1 "Article %d is unsaveable" article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13033 ;; This is a real article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13034 (save-window-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13035 (gnus-summary-select-article t nil nil article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13036 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13037 (set-buffer save-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13038 (erase-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13039 (insert-buffer-substring gnus-original-article-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13040 (unless gnus-save-all-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13041 ;; Remove headers accoring to `gnus-saved-headers'.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13042 (let ((gnus-visible-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13043 (or gnus-saved-headers gnus-visible-headers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13044 (gnus-article-buffer save-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13045 (gnus-article-hide-headers 1 t)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13046 (save-window-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13047 (if (not gnus-default-article-saver)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13048 (error "No default saver is defined.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13049 ;; !!! Magic! The saving functions all save
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13050 ;; `gnus-original-article-buffer' (or so they think),
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13051 ;; but we bind that variable to our save-buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13052 (set-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13053 (let ((gnus-original-article-buffer save-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13054 (set-buffer gnus-summary-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13055 (setq file (funcall
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13056 gnus-default-article-saver
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13057 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13058 ((not gnus-prompt-before-saving)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13059 'default)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13060 ((eq gnus-prompt-before-saving 'always)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13061 nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13062 (t file)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13063 (gnus-summary-remove-process-mark article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13064 (unless not-saved
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13065 (gnus-summary-set-saved-mark article))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13066 (gnus-kill-buffer save-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13067 (gnus-summary-position-point)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13068 n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13069
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13070 (defun gnus-summary-pipe-output (&optional arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13071 "Pipe the current article to a subprocess.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13072 If N is a positive number, pipe the N next articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13073 If N is a negative number, pipe the N previous articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13074 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
13075 pipe those articles instead."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13076 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13077 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13078 (let ((gnus-default-article-saver 'gnus-summary-save-in-pipe))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13079 (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
13080 (gnus-configure-windows 'pipe))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13081
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13082 (defun gnus-summary-save-article-mail (&optional arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13083 "Append the current article to an mail file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13084 If N is a positive number, save the N next articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13085 If N is a negative number, save the N previous articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13086 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
13087 save those articles instead."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13088 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13089 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13090 (let ((gnus-default-article-saver 'gnus-summary-save-in-mail))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13091 (gnus-summary-save-article arg)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13092
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13093 (defun gnus-summary-save-article-rmail (&optional arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13094 "Append the current article to an rmail file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13095 If N is a positive number, save the N next articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13096 If N is a negative number, save the N previous articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13097 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
13098 save those articles instead."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13099 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13100 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13101 (let ((gnus-default-article-saver 'gnus-summary-save-in-rmail))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13102 (gnus-summary-save-article arg)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13103
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13104 (defun gnus-summary-save-article-file (&optional arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13105 "Append the current article to a file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13106 If N is a positive number, save the N next articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13107 If N is a negative number, save the N previous articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13108 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
13109 save those articles instead."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13110 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13111 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13112 (let ((gnus-default-article-saver 'gnus-summary-save-in-file))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13113 (gnus-summary-save-article arg)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13114
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13115 (defun gnus-summary-save-article-body-file (&optional arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13116 "Append the current article body to a file.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13117 If N is a positive number, save the N next articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13118 If N is a negative number, save the N previous articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13119 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
13120 save those articles instead."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13121 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13122 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13123 (let ((gnus-default-article-saver 'gnus-summary-save-body-in-file))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13124 (gnus-summary-save-article arg)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13125
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13126 (defun gnus-get-split-value (methods)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13127 "Return a value based on the split METHODS."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13128 (let (split-name method result match)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13129 (when methods
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13130 (save-excursion
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13131 (set-buffer gnus-original-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13132 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13133 (nnheader-narrow-to-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13134 (while methods
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13135 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13136 (setq method (pop methods))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13137 (setq match (car method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13138 (when (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13139 ((stringp match)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13140 ;; Regular expression.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13141 (condition-case ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13142 (re-search-forward match nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13143 (error nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13144 ((gnus-functionp match)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13145 ;; Function.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13146 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13147 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13148 (setq result (funcall match gnus-newsgroup-name))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13149 ((consp match)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13150 ;; Form.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13151 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13152 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13153 (setq result (eval match)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13154 (setq split-name (append (cdr method) split-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13155 (cond ((stringp result)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13156 (push result split-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13157 ((consp result)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13158 (setq split-name (append result split-name)))))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13159 split-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13160
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13161 (defun gnus-read-move-group-name (prompt default articles prefix)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13162 "Read a group name."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13163 (let* ((split-name (gnus-get-split-value gnus-move-split-methods))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13164 (minibuffer-confirm-incomplete nil) ; XEmacs
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13165 group-map
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13166 (dum (mapatoms
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13167 (lambda (g)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13168 (and (boundp g)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13169 (symbol-name g)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13170 (memq 'respool
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13171 (assoc (symbol-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13172 (car (gnus-find-method-for-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13173 (symbol-name g))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13174 gnus-valid-select-methods))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13175 (push (list (symbol-name g)) group-map)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13176 gnus-active-hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13177 (prom
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13178 (format "%s %s to:"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13179 prompt
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13180 (if (> (length articles) 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13181 (format "these %d articles" (length articles))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13182 "this article")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13183 (to-newsgroup
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13184 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13185 ((null split-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13186 (gnus-completing-read default prom
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13187 group-map nil nil prefix
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13188 'gnus-group-history))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13189 ((= 1 (length split-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13190 (gnus-completing-read (car split-name) prom group-map
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13191 nil nil nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13192 'gnus-group-history))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13193 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13194 (gnus-completing-read nil prom
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13195 (mapcar (lambda (el) (list el))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13196 (nreverse split-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13197 nil nil nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13198 'gnus-group-history)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13199 (when to-newsgroup
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13200 (if (or (string= to-newsgroup "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13201 (string= to-newsgroup prefix))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13202 (setq to-newsgroup (or default "")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13203 (or (gnus-active to-newsgroup)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13204 (gnus-activate-group to-newsgroup)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13205 (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
13206 to-newsgroup))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13207 (or (and (gnus-request-create-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13208 to-newsgroup (gnus-group-name-to-method to-newsgroup))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13209 (gnus-activate-group to-newsgroup nil nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13210 (gnus-group-name-to-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13211 to-newsgroup)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13212 (error "Couldn't create group %s" to-newsgroup)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13213 (error "No such group: %s" to-newsgroup)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13214 to-newsgroup))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13215
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13216 (defun gnus-read-save-file-name (prompt default-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13217 (let* ((split-name (gnus-get-split-value gnus-split-methods))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13218 (file
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13219 ;; Let the split methods have their say.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13220 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13221 ;; No split name was found.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13222 ((null split-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13223 (read-file-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13224 (concat prompt " (default "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13225 (file-name-nondirectory default-name) ") ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13226 (file-name-directory default-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13227 default-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13228 ;; A single split name was found
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13229 ((= 1 (length split-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13230 (let* ((name (car split-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13231 (dir (cond ((file-directory-p name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13232 (file-name-as-directory name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13233 ((file-exists-p name) name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13234 (t gnus-article-save-directory))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13235 (read-file-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13236 (concat prompt " (default " name ") ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13237 dir name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13238 ;; A list of splits was found.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13239 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13240 (setq split-name (nreverse split-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13241 (let (result)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13242 (let ((file-name-history (nconc split-name file-name-history)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13243 (setq result
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13244 (read-file-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13245 (concat prompt " (`M-p' for defaults) ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13246 gnus-article-save-directory
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13247 (car split-name))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13248 (car (push result file-name-history)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13249 ;; 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
13250 (when (file-directory-p file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13251 (setq file (concat (file-name-as-directory file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13252 (file-name-nondirectory default-name))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13253 ;; Possibly translate some charaters.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13254 (nnheader-translate-file-chars file)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13255
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13256 (defun gnus-article-archive-name (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13257 "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
13258 (let ((case-fold-search t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13259 (when (re-search-forward "archive-name: *\\([^ \n\t]+\\)[ \t]*$" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13260 (match-string 1))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13261
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13262 (defun gnus-summary-save-in-rmail (&optional filename)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13263 "Append this article to Rmail file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13264 Optional argument FILENAME specifies file name.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13265 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
13266 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13267 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13268 (let ((default-name
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13269 (funcall gnus-rmail-save-name gnus-newsgroup-name
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13270 gnus-current-headers gnus-newsgroup-last-rmail)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13271 (setq filename
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13272 (cond ((eq filename 'default)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13273 default-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13274 (filename filename)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13275 (t (gnus-read-save-file-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13276 "Save in rmail file:" default-name))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13277 (gnus-make-directory (file-name-directory filename))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13278 (gnus-eval-in-buffer-window gnus-original-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13279 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13280 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13281 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13282 (gnus-output-to-rmail filename))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13283 ;; Remember the directory name to save articles
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13284 (setq gnus-newsgroup-last-rmail filename)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13285
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13286 (defun gnus-summary-save-in-mail (&optional filename)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13287 "Append this article to Unix mail file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13288 Optional argument FILENAME specifies file name.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13289 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
13290 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13291 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13292 (let ((default-name
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13293 (funcall gnus-mail-save-name gnus-newsgroup-name
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13294 gnus-current-headers gnus-newsgroup-last-mail)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13295 (setq filename
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13296 (cond ((eq filename 'default)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13297 default-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13298 (filename filename)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13299 (t (gnus-read-save-file-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13300 "Save in Unix mail file:" default-name))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13301 (setq filename
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13302 (expand-file-name filename
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13303 (and default-name
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13304 (file-name-directory default-name))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13305 (gnus-make-directory (file-name-directory filename))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13306 (gnus-eval-in-buffer-window gnus-original-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13307 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13308 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13309 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13310 (if (and (file-readable-p filename) (mail-file-babyl-p filename))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13311 (gnus-output-to-rmail filename)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13312 (let ((mail-use-rfc822 t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13313 (rmail-output filename 1 t t))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13314 ;; Remember the directory name to save articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13315 (setq gnus-newsgroup-last-mail filename)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13316
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13317 (defun gnus-summary-save-in-file (&optional filename)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13318 "Append this article to file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13319 Optional argument FILENAME specifies file name.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13320 Directory to save to is default to `gnus-article-save-directory'."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13321 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13322 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13323 (let ((default-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13324 (funcall gnus-file-save-name gnus-newsgroup-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13325 gnus-current-headers gnus-newsgroup-last-file)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13326 (setq filename
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13327 (cond ((eq filename 'default)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13328 default-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13329 (filename filename)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13330 (t (gnus-read-save-file-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13331 "Save in file:" default-name))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13332 (gnus-make-directory (file-name-directory filename))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13333 (gnus-eval-in-buffer-window gnus-original-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13334 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13335 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13336 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13337 (gnus-output-to-file filename))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13338 ;; Remember the directory name to save articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13339 (setq gnus-newsgroup-last-file filename)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13340
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13341 (defun gnus-summary-save-body-in-file (&optional filename)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13342 "Append this article body to a file.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13343 Optional argument FILENAME specifies file name.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13344 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
13345 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13346 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13347 (let ((default-name
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13348 (funcall gnus-file-save-name gnus-newsgroup-name
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13349 gnus-current-headers gnus-newsgroup-last-file)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13350 (setq filename
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13351 (cond ((eq filename 'default)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13352 default-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13353 (filename filename)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13354 (t (gnus-read-save-file-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13355 "Save body in file:" default-name))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13356 (gnus-make-directory (file-name-directory filename))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13357 (gnus-eval-in-buffer-window gnus-original-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13358 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13359 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13360 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13361 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13362 (and (search-forward "\n\n" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13363 (narrow-to-region (point) (point-max)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13364 (gnus-output-to-file filename))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13365 ;; Remember the directory name to save articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13366 (setq gnus-newsgroup-last-file filename)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13367
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13368 (defun gnus-summary-save-in-pipe (&optional command)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13369 "Pipe this article to subprocess."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13370 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13371 (gnus-set-global-variables)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13372 (setq command
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13373 (cond ((eq command 'default)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13374 gnus-last-shell-command)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13375 (command command)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13376 (t (read-string "Shell command on article: "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13377 gnus-last-shell-command))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13378 (if (string-equal command "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13379 (setq command gnus-last-shell-command))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13380 (gnus-eval-in-buffer-window gnus-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13381 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13382 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13383 (shell-command-on-region (point-min) (point-max) command nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13384 (setq gnus-last-shell-command command))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13385
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13386 ;; Summary extract commands
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 (defun gnus-summary-insert-pseudos (pslist &optional not-view)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13389 (let ((buffer-read-only nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13390 (article (gnus-summary-article-number))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13391 after-article b e)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13392 (or (gnus-summary-goto-subject article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13393 (error (format "No such article: %d" article)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13394 (gnus-summary-position-point)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13395 ;; 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
13396 ;; them here.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13397 (if gnus-view-pseudos-separately
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13398 ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13399 (let ((ps (setq pslist (sort pslist 'gnus-pseudos<)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13400 files action)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13401 (while ps
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13402 (setq action (cdr (assq 'action (car ps))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13403 (setq files (list (cdr (assq 'name (car ps)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13404 (while (and ps (cdr ps)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13405 (string= (or action "1")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13406 (or (cdr (assq 'action (cadr ps))) "2")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13407 (setq files (cons (cdr (assq 'name (cadr ps))) files))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13408 (setcdr ps (cddr ps)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13409 (if (not files)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13410 ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13411 (if (not (string-match "%s" action))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13412 (setq files (cons " " files)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13413 (setq files (cons " " files))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13414 (and (assq 'execute (car ps))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13415 (setcdr (assq 'execute (car ps))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13416 (funcall (if (string-match "%s" action)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13417 'format 'concat)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13418 action
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13419 (mapconcat (lambda (f) f) files " ")))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13420 (setq ps (cdr ps)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13421 (if (and gnus-view-pseudos (not not-view))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13422 (while pslist
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13423 (and (assq 'execute (car pslist))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13424 (gnus-execute-command (cdr (assq 'execute (car pslist)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13425 (eq gnus-view-pseudos 'not-confirm)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13426 (setq pslist (cdr pslist)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13427 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13428 (while pslist
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13429 (setq after-article (or (cdr (assq 'article (car pslist)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13430 (gnus-summary-article-number)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13431 (gnus-summary-goto-subject after-article)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13432 (forward-line 1)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13433 (setq b (point))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13434 (insert " " (file-name-nondirectory
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13435 (cdr (assq 'name (car pslist))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13436 ": " (or (cdr (assq 'execute (car pslist))) "") "\n")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13437 (setq e (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13438 (forward-line -1) ; back to `b'
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13439 (gnus-add-text-properties
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13440 b (1- e) (list 'gnus-number gnus-reffed-article-number
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13441 gnus-mouse-face-prop gnus-mouse-face))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13442 (gnus-data-enter
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13443 after-article gnus-reffed-article-number
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13444 gnus-unread-mark b (car pslist) 0 (- e b))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13445 (push gnus-reffed-article-number gnus-newsgroup-unreads)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13446 (setq gnus-reffed-article-number (1- gnus-reffed-article-number))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13447 (setq pslist (cdr pslist)))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13448
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13449 (defun gnus-pseudos< (p1 p2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13450 (let ((c1 (cdr (assq 'action p1)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13451 (c2 (cdr (assq 'action p2))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13452 (and c1 c2 (string< c1 c2))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13453
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13454 (defun gnus-request-pseudo-article (props)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13455 (cond ((assq 'execute props)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13456 (gnus-execute-command (cdr (assq 'execute props)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13457 (let ((gnus-current-article (gnus-summary-article-number)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13458 (run-hooks 'gnus-mark-article-hook)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13459
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13460 (defun gnus-execute-command (command &optional automatic)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13461 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13462 (gnus-article-setup-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13463 (set-buffer gnus-article-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13464 (setq buffer-read-only nil)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13465 (let ((command (if automatic command (read-string "Command: " command)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13466 ;; Just binding this here doesn't help, because there might
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13467 ;; be output from the process after exiting the scope of
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13468 ;; this `let'.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13469 ;; (buffer-read-only nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13470 )
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13471 (erase-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13472 (insert "$ " command "\n\n")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13473 (if gnus-view-pseudo-asynchronously
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13474 (start-process "gnus-execute" nil shell-file-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13475 shell-command-switch command)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13476 (call-process shell-file-name nil t nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13477 shell-command-switch command)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13478
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13479 (defun gnus-copy-file (file &optional to)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13480 "Copy FILE to TO."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13481 (interactive
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13482 (list (read-file-name "Copy file: " default-directory)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13483 (read-file-name "Copy file to: " default-directory)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13484 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13485 (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
13486 (and (file-directory-p to)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13487 (setq to (concat (file-name-as-directory to)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13488 (file-name-nondirectory file))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13489 (copy-file file to))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13490
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13491 ;; Summary kill commands.
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 (defun gnus-summary-edit-global-kill (article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13494 "Edit the \"global\" kill file."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13495 (interactive (list (gnus-summary-article-number)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13496 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13497 (gnus-group-edit-global-kill article))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13498
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13499 (defun gnus-summary-edit-local-kill ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13500 "Edit a local kill file applied to the current newsgroup."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13501 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13502 (gnus-set-global-variables)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13503 (setq gnus-current-headers (gnus-summary-article-header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13504 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13505 (gnus-group-edit-local-kill
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13506 (gnus-summary-article-number) gnus-newsgroup-name))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13507
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13508
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 ;;; Gnus article mode
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
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13513 (put 'gnus-article-mode 'mode-class 'special)
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 (if gnus-article-mode-map
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13516 nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13517 (setq gnus-article-mode-map (make-keymap))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13518 (suppress-keymap gnus-article-mode-map)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13519
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13520 (gnus-define-keys gnus-article-mode-map
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13521 " " gnus-article-goto-next-page
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13522 "\177" gnus-article-goto-prev-page
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13523 [delete] gnus-article-goto-prev-page
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13524 "\C-c^" gnus-article-refer-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13525 "h" gnus-article-show-summary
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13526 "s" gnus-article-show-summary
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13527 "\C-c\C-m" gnus-article-mail
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13528 "?" gnus-article-describe-briefly
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13529 gnus-mouse-2 gnus-article-push-button
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13530 "\r" gnus-article-press-button
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13531 "\t" gnus-article-next-button
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13532 "\M-\t" gnus-article-prev-button
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13533 "<" beginning-of-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13534 ">" end-of-buffer
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
13535 "\C-c\C-i" gnus-info-find-node
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13536 "\C-c\C-b" gnus-bug)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13537
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13538 (substitute-key-definition
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13539 'undefined 'gnus-article-read-summary-keys gnus-article-mode-map))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13540
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13541 (defun gnus-article-mode ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13542 "Major mode for displaying an article.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13543
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13544 All normal editing commands are switched off.
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 The following commands are available:
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 \\<gnus-article-mode-map>
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13549 \\[gnus-article-next-page]\t Scroll the article one page forwards
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13550 \\[gnus-article-prev-page]\t Scroll the article one page backwards
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13551 \\[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
13552 \\[gnus-article-show-summary]\t Display the summary buffer
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13553 \\[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
13554 \\[gnus-article-describe-briefly]\t Describe the current mode briefly
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13555 \\[gnus-info-find-node]\t Go to the Gnus info node"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13556 (interactive)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13557 (when (and menu-bar-mode
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13558 (gnus-visual-p 'article-menu 'menu))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13559 (gnus-article-make-menu-bar))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13560 (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
13561 (gnus-simplify-mode-line)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13562 (setq mode-name "Article")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13563 (setq major-mode 'gnus-article-mode)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13564 (make-local-variable 'minor-mode-alist)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13565 (or (assq 'gnus-show-mime minor-mode-alist)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13566 (setq minor-mode-alist
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13567 (cons (list 'gnus-show-mime " MIME") minor-mode-alist)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13568 (use-local-map gnus-article-mode-map)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13569 (make-local-variable 'page-delimiter)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13570 (setq page-delimiter gnus-page-delimiter)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13571 (buffer-disable-undo (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13572 (setq buffer-read-only t) ;Disable modification
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13573 (run-hooks 'gnus-article-mode-hook))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13574
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13575 (defun gnus-article-setup-buffer ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13576 "Initialize the article buffer."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13577 (let* ((name (if gnus-single-article-buffer "*Article*"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13578 (concat "*Article " gnus-newsgroup-name "*")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13579 (original
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13580 (progn (string-match "\\*Article" name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13581 (concat " *Original Article"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13582 (substring name (match-end 0))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13583 (setq gnus-article-buffer name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13584 (setq gnus-original-article-buffer original)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13585 ;; This might be a variable local to the summary buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13586 (unless gnus-single-article-buffer
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13587 (save-excursion
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13588 (set-buffer gnus-summary-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13589 (setq gnus-article-buffer name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13590 (setq gnus-original-article-buffer original)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13591 (gnus-set-global-variables))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13592 (make-local-variable 'gnus-summary-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13593 ;; Init original article buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13594 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13595 (set-buffer (get-buffer-create gnus-original-article-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13596 (buffer-disable-undo (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13597 (setq major-mode 'gnus-original-article-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13598 (make-local-variable 'gnus-original-article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13599 (if (get-buffer name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13600 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13601 (set-buffer name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13602 (buffer-disable-undo (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13603 (setq buffer-read-only t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13604 (gnus-add-current-to-buffer-list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13605 (or (eq major-mode 'gnus-article-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13606 (gnus-article-mode))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13607 (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13608 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13609 (set-buffer (get-buffer-create name))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13610 (gnus-add-current-to-buffer-list)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13611 (gnus-article-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13612 (current-buffer)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13613
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13614 ;; 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
13615 ;; from the head of the article.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13616 (defun gnus-article-set-window-start (&optional line)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13617 (set-window-start
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13618 (get-buffer-window gnus-article-buffer t)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13619 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13620 (set-buffer gnus-article-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13621 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13622 (if (not line)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13623 (point-min)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13624 (gnus-message 6 "Moved to bookmark")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13625 (search-forward "\n\n" nil t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13626 (forward-line line)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13627 (point)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13628
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13629 (defun gnus-kill-all-overlays ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13630 "Delete all overlays in the current buffer."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13631 (when (fboundp 'overlay-lists)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13632 (let* ((overlayss (overlay-lists))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13633 (buffer-read-only nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13634 (overlays (nconc (car overlayss) (cdr overlayss))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13635 (while overlays
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13636 (delete-overlay (pop overlays))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13637
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13638 (defun gnus-request-article-this-buffer (article group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13639 "Get an article and insert it into this buffer."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13640 (let (do-update-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13641 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13642 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13643 (erase-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13644 (gnus-kill-all-overlays)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13645 (setq group (or group gnus-newsgroup-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13646
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13647 ;; Open server if it has closed.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13648 (gnus-check-server (gnus-find-method-for-group group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13649
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13650 ;; Using `gnus-request-article' directly will insert the article into
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13651 ;; `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
13652 ;; copy it from the server buffer into the article buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13653
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13654 ;; 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
13655 ;; headers for it, so we'll have to get those.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13656 (when (stringp article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13657 (let ((gnus-override-method gnus-refer-article-method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13658 (gnus-read-header article)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13659
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13660 ;; If the article number is negative, that means that this article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13661 ;; doesn't belong in this newsgroup (possibly), so we find its
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13662 ;; message-id and request it by id instead of number.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13663 (when (and (numberp article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13664 gnus-summary-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13665 (get-buffer gnus-summary-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13666 (buffer-name (get-buffer gnus-summary-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13667 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13668 (set-buffer gnus-summary-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13669 (let ((header (gnus-summary-article-header article)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13670 (if (< article 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13671 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13672 ((memq article gnus-newsgroup-sparse)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13673 ;; This is a sparse gap article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13674 (setq do-update-line article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13675 (setq article (mail-header-id header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13676 (let ((gnus-override-method gnus-refer-article-method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13677 (gnus-read-header article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13678 (setq gnus-newsgroup-sparse
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13679 (delq article gnus-newsgroup-sparse)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13680 ((vectorp header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13681 ;; It's a real article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13682 (setq article (mail-header-id header)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13683 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13684 ;; It is an extracted pseudo-article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13685 (setq article 'pseudo)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13686 (gnus-request-pseudo-article header))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13687
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13688 (let ((method (gnus-find-method-for-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13689 gnus-newsgroup-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13690 (if (not (eq (car method) 'nneething))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13691 ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13692 (let ((dir (concat (file-name-as-directory (nth 1 method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13693 (mail-header-subject header))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13694 (if (file-directory-p dir)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13695 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13696 (setq article 'nneething)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13697 (gnus-group-enter-directory dir)))))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13698
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13699 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13700 ;; Refuse to select canceled articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13701 ((and (numberp article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13702 gnus-summary-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13703 (get-buffer gnus-summary-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13704 (buffer-name (get-buffer gnus-summary-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13705 (eq (cdr (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13706 (set-buffer gnus-summary-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13707 (assq article gnus-newsgroup-reads)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13708 gnus-canceled-mark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13709 nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13710 ;; We first check `gnus-original-article-buffer'.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13711 ((and (get-buffer gnus-original-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13712 (numberp article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13713 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13714 (set-buffer gnus-original-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13715 (and (equal (car gnus-original-article) group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13716 (eq (cdr gnus-original-article) article))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13717 (insert-buffer-substring gnus-original-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13718 'article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13719 ;; Check the backlog.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13720 ((and gnus-keep-backlog
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13721 (gnus-backlog-request-article group article (current-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13722 'article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13723 ;; Check the cache.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13724 ((and gnus-use-cache
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13725 (numberp article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13726 (gnus-cache-request-article article group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13727 'article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13728 ;; Get the article and put into the article buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13729 ((or (stringp article) (numberp article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13730 (let ((gnus-override-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13731 (and (stringp article) gnus-refer-article-method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13732 (buffer-read-only nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13733 (erase-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13734 (gnus-kill-all-overlays)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13735 (if (gnus-request-article article group (current-buffer))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13736 (progn
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13737 (and gnus-keep-backlog
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13738 (numberp article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13739 (gnus-backlog-enter-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13740 group article (current-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13741 'article))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13742 ;; It was a pseudo.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13743 (t article)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13744
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13745 ;; Take the article from the original article buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13746 ;; 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
13747 (when (and (get-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13748 ;;(numberp article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13749 (equal (buffer-name (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13750 (buffer-name (get-buffer gnus-article-buffer))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13751 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13752 (if (get-buffer gnus-original-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13753 (set-buffer (get-buffer gnus-original-article-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13754 (set-buffer (get-buffer-create gnus-original-article-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13755 (buffer-disable-undo (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13756 (setq major-mode 'gnus-original-article-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13757 (setq buffer-read-only t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13758 (gnus-add-current-to-buffer-list))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13759 (let (buffer-read-only)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13760 (erase-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13761 (insert-buffer-substring gnus-article-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13762 (setq gnus-original-article (cons group article))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13763
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13764 ;; Update sparse articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13765 (when (and do-update-line
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13766 (or (numberp article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13767 (stringp article)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13768 (let ((buf (current-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13769 (set-buffer gnus-summary-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13770 (gnus-summary-update-article do-update-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13771 (gnus-summary-goto-subject do-update-line nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13772 (set-window-point (get-buffer-window (current-buffer) t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13773 (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13774 (set-buffer buf))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13775
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13776 (defun gnus-read-header (id &optional header)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13777 "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
13778 (let ((group gnus-newsgroup-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13779 (gnus-override-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13780 (and (gnus-news-group-p gnus-newsgroup-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13781 gnus-refer-article-method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13782 where)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13783 ;; 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
13784 ;; fetched.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13785 (if (stringp id)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13786 ;; This is a Message-ID.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13787 (setq header (or header (gnus-id-to-header id)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13788 ;; This is an article number.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13789 (setq header (or header (gnus-summary-article-header id))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13790 (if (and header
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13791 (not (memq (mail-header-number header) gnus-newsgroup-sparse)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13792 ;; We have found the header.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13793 header
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13794 ;; We have to really fetch the header to this article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13795 (when (setq where (gnus-request-head id group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13796 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13797 (set-buffer nntp-server-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13798 (goto-char (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13799 (insert ".\n")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13800 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13801 (insert "211 ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13802 (princ (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13803 ((numberp id) id)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13804 ((cdr where) (cdr where))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13805 (header (mail-header-number header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13806 (t gnus-reffed-article-number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13807 (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13808 (insert " Article retrieved.\n"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13809 ;(when (and header
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13810 ; (memq (mail-header-number header) gnus-newsgroup-sparse))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13811 ; (setcar (gnus-id-to-thread id) nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13812 (if (not (setq header (car (gnus-get-newsgroup-headers))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13813 () ; Malformed head.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13814 (unless (memq (mail-header-number header) gnus-newsgroup-sparse)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13815 (if (and (stringp id)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13816 (not (string= (gnus-group-real-name group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13817 (car where))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13818 ;; If we fetched by Message-ID and the article came
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13819 ;; from a different group, we fudge some bogus article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13820 ;; numbers for this article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13821 (mail-header-set-number header gnus-reffed-article-number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13822 (decf gnus-reffed-article-number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13823 (gnus-remove-header (mail-header-number header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13824 (push header gnus-newsgroup-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13825 (setq gnus-current-headers header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13826 (push (mail-header-number header) gnus-newsgroup-limit))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13827 header)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13828
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13829 (defun gnus-remove-header (number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13830 "Remove header NUMBER from `gnus-newsgroup-headers'."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13831 (if (and gnus-newsgroup-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13832 (= number (mail-header-number (car gnus-newsgroup-headers))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13833 (pop gnus-newsgroup-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13834 (let ((headers gnus-newsgroup-headers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13835 (while (and (cdr headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13836 (not (= number (mail-header-number (cadr headers)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13837 (pop headers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13838 (when (cdr headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13839 (setcdr headers (cddr headers))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13840
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13841 (defun gnus-article-prepare (article &optional all-headers header)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13842 "Prepare ARTICLE in article mode buffer.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13843 ARTICLE should either be an article number or a Message-ID.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13844 If ARTICLE is an id, HEADER should be the article headers.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13845 If ALL-HEADERS is non-nil, no headers are hidden."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13846 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13847 ;; Make sure we start in a summary buffer.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13848 (unless (eq major-mode 'gnus-summary-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13849 (set-buffer gnus-summary-buffer))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13850 (setq gnus-summary-buffer (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13851 ;; Make sure the connection to the server is alive.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13852 (unless (gnus-server-opened
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13853 (gnus-find-method-for-group gnus-newsgroup-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13854 (gnus-check-server (gnus-find-method-for-group gnus-newsgroup-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13855 (gnus-request-group gnus-newsgroup-name t))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13856 (let* ((article (if header (mail-header-number header) article))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13857 (summary-buffer (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13858 (internal-hook gnus-article-internal-prepare-hook)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13859 (group gnus-newsgroup-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13860 result)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13861 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13862 (gnus-article-setup-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13863 (set-buffer gnus-article-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13864 ;; Deactivate active regions.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13865 (when (and (boundp 'transient-mark-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13866 transient-mark-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13867 (setq mark-active nil))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13868 (if (not (setq result (let ((buffer-read-only nil))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13869 (gnus-request-article-this-buffer
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13870 article group))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13871 ;; There is no such article.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13872 (save-excursion
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13873 (when (and (numberp article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13874 (not (memq article gnus-newsgroup-sparse)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13875 (setq gnus-article-current
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13876 (cons gnus-newsgroup-name article))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13877 (set-buffer gnus-summary-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13878 (setq gnus-current-article article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13879 (gnus-summary-mark-article article gnus-canceled-mark))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13880 (unless (memq article gnus-newsgroup-sparse)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13881 (gnus-error
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13882 1 "No such article (may have expired or been canceled)")))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13883 (if (or (eq result 'pseudo) (eq result 'nneething))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13884 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13885 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13886 (set-buffer summary-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13887 (setq gnus-last-article gnus-current-article
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13888 gnus-newsgroup-history (cons gnus-current-article
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13889 gnus-newsgroup-history)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13890 gnus-current-article 0
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13891 gnus-current-headers nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13892 gnus-article-current nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13893 (if (eq result 'nneething)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13894 (gnus-configure-windows 'summary)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13895 (gnus-configure-windows 'article))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13896 (gnus-set-global-variables))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13897 (gnus-set-mode-line 'article))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13898 ;; The result from the `request' was an actual article -
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13899 ;; or at least some text that is now displayed in the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13900 ;; article buffer.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13901 (if (and (numberp article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13902 (not (eq article gnus-current-article)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13903 ;; Seems like a new article has been selected.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13904 ;; `gnus-current-article' must be an article number.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13905 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13906 (set-buffer summary-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13907 (setq gnus-last-article gnus-current-article
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13908 gnus-newsgroup-history (cons gnus-current-article
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13909 gnus-newsgroup-history)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13910 gnus-current-article article
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13911 gnus-current-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13912 (gnus-summary-article-header gnus-current-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13913 gnus-article-current
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13914 (cons gnus-newsgroup-name gnus-current-article))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13915 (unless (vectorp gnus-current-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13916 (setq gnus-current-headers nil))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13917 (gnus-summary-show-thread)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13918 (run-hooks 'gnus-mark-article-hook)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13919 (gnus-set-mode-line 'summary)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13920 (and (gnus-visual-p 'article-highlight 'highlight)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13921 (run-hooks 'gnus-visual-mark-article-hook))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13922 ;; Set the global newsgroup variables here.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13923 ;; Suggested by Jim Sisolak
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13924 ;; <sisolak@trans4.neep.wisc.edu>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13925 (gnus-set-global-variables)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13926 (setq gnus-have-all-headers
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13927 (or all-headers gnus-show-all-headers))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13928 (and gnus-use-cache
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13929 (vectorp (gnus-summary-article-header article))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13930 (gnus-cache-possibly-enter-article
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13931 group article
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13932 (gnus-summary-article-header article)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13933 (memq article gnus-newsgroup-marked)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13934 (memq article gnus-newsgroup-dormant)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13935 (memq article gnus-newsgroup-unreads)))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13936 (when (or (numberp article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13937 (stringp article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13938 ;; Hooks for getting information from the article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13939 ;; This hook must be called before being narrowed.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13940 (let (buffer-read-only)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13941 (run-hooks 'internal-hook)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13942 (run-hooks 'gnus-article-prepare-hook)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13943 ;; Decode MIME message.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13944 (if gnus-show-mime
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13945 (if (or (not gnus-strict-mime)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13946 (gnus-fetch-field "Mime-Version"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13947 (funcall gnus-show-mime-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13948 (funcall gnus-decode-encoded-word-method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13949 ;; Perform the article display hooks.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13950 (run-hooks 'gnus-article-display-hook))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13951 ;; Do page break.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13952 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13953 (and gnus-break-pages (gnus-narrow-to-page)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13954 (gnus-set-mode-line 'article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13955 (gnus-configure-windows 'article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13956 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13957 t))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13958
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13959 (defun gnus-article-show-all-headers ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13960 "Show all article headers in article mode buffer."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13961 (save-excursion
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13962 (gnus-article-setup-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13963 (set-buffer gnus-article-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13964 (let ((buffer-read-only nil))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13965 (gnus-unhide-text (point-min) (point-max)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13966
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13967 (defun gnus-article-hide-headers-if-wanted ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13968 "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
13969 Provided for backwards compatibility."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13970 (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
13971 gnus-inhibit-hiding
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13972 (gnus-article-hide-headers)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13973
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13974 (defsubst gnus-article-header-rank ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13975 "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
13976 (let ((list gnus-sorted-header-list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13977 (i 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13978 (while list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13979 (when (looking-at (car list))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13980 (setq list nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13981 (setq list (cdr list))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13982 (incf i))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13983 i))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13984
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13985 (defun gnus-article-hide-headers (&optional arg delete)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13986 "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
13987 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
13988 always hide."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13989 (interactive (gnus-hidden-arg))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13990 (if (gnus-article-check-hidden-text 'headers arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13991 ;; Show boring headers as well.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13992 (gnus-article-show-hidden-text 'boring-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13993 ;; This function might be inhibited.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13994 (unless gnus-inhibit-hiding
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13995 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13996 (set-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13997 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13998 (let ((buffer-read-only nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13999 (props (nconc (list 'gnus-type 'headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14000 gnus-hidden-properties))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14001 (max (1+ (length gnus-sorted-header-list)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14002 (ignored (when (not (stringp gnus-visible-headers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14003 (cond ((stringp gnus-ignored-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14004 gnus-ignored-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14005 ((listp gnus-ignored-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14006 (mapconcat 'identity gnus-ignored-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14007 "\\|")))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14008 (visible
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14009 (cond ((stringp gnus-visible-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14010 gnus-visible-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14011 ((and gnus-visible-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14012 (listp gnus-visible-headers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14013 (mapconcat 'identity gnus-visible-headers "\\|"))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14014 (inhibit-point-motion-hooks t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14015 want-list beg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14016 ;; First we narrow to just the headers.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14017 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14018 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14019 ;; Hide any "From " lines at the beginning of (mail) articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14020 (while (looking-at "From ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14021 (forward-line 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14022 (unless (bobp)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14023 (if delete
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14024 (delete-region (point-min) (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14025 (gnus-hide-text (point-min) (point) props)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14026 ;; Then treat the rest of the header lines.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14027 (narrow-to-region
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14028 (point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14029 (progn (search-forward "\n\n" nil t) (forward-line -1) (point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14030 ;; Then we use the two regular expressions
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14031 ;; `gnus-ignored-headers' and `gnus-visible-headers' to
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14032 ;; select which header lines is to remain visible in the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14033 ;; article buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14034 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14035 (while (re-search-forward "^[^ \t]*:" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14036 (beginning-of-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14037 ;; 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
14038 ;; them from the buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14039 (gnus-put-text-property
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14040 (point) (1+ (point)) 'message-rank
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14041 (if (or (and visible (looking-at visible))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14042 (and ignored
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14043 (not (looking-at ignored))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14044 (gnus-article-header-rank)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14045 (+ 2 max)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14046 (forward-line 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14047 (message-sort-headers-1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14048 (when (setq beg (text-property-any
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14049 (point-min) (point-max) 'message-rank (+ 2 max)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14050 ;; We make the unwanted headers invisible.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14051 (if delete
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14052 (delete-region beg (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14053 ;; Suggested by Sudish Joseph <joseph@cis.ohio-state.edu>.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14054 (gnus-hide-text-type beg (point-max) 'headers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14055 ;; Work around XEmacs lossage.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14056 (gnus-put-text-property (point-min) beg 'invisible nil))))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14057
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14058 (defun gnus-article-hide-boring-headers (&optional arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14059 "Toggle hiding of headers that aren't very interesting.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14060 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
14061 always hide."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14062 (interactive (gnus-hidden-arg))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14063 (unless (gnus-article-check-hidden-text 'boring-headers arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14064 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14065 (set-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14066 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14067 (let ((buffer-read-only nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14068 (list gnus-boring-article-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14069 (inhibit-point-motion-hooks t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14070 elem)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14071 (nnheader-narrow-to-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14072 (while list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14073 (setq elem (pop list))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14074 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14075 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14076 ;; Hide empty headers.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14077 ((eq elem 'empty)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14078 (while (re-search-forward "^[^:]+:[ \t]\n[^ \t]" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14079 (forward-line -1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14080 (gnus-hide-text-type
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14081 (progn (beginning-of-line) (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14082 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14083 (end-of-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14084 (if (re-search-forward "^[^ \t]" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14085 (match-beginning 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14086 (point-max)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14087 'boring-headers)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14088 ;; Hide boring Newsgroups header.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14089 ((eq elem 'newsgroups)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14090 (when (equal (message-fetch-field "newsgroups")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14091 (gnus-group-real-name gnus-newsgroup-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14092 (gnus-article-hide-header "newsgroups")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14093 ((eq elem 'followup-to)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14094 (when (equal (message-fetch-field "followup-to")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14095 (message-fetch-field "newsgroups"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14096 (gnus-article-hide-header "followup-to")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14097 ((eq elem 'reply-to)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14098 (let ((from (message-fetch-field "from"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14099 (reply-to (message-fetch-field "reply-to")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14100 (when (and
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14101 from reply-to
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14102 (equal
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14103 (nth 1 (funcall gnus-extract-address-components from))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14104 (nth 1 (funcall gnus-extract-address-components
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14105 reply-to))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14106 (gnus-article-hide-header "reply-to"))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14107 ((eq elem 'date)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14108 (let ((date (message-fetch-field "date")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14109 (when (and date
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14110 (< (gnus-days-between date (current-time-string))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14111 4))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14112 (gnus-article-hide-header "date")))))))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14113
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14114 (defun gnus-article-hide-header (header)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14115 (save-excursion
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14116 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14117 (when (re-search-forward (concat "^" header ":") nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14118 (gnus-hide-text-type
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14119 (progn (beginning-of-line) (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14120 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14121 (end-of-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14122 (if (re-search-forward "^[^ \t]" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14123 (match-beginning 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14124 (point-max)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14125 'boring-headers))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14126
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14127 ;; Written by Per Abrahamsen <amanda@iesd.auc.dk>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14128 (defun gnus-article-treat-overstrike ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14129 "Translate overstrikes into bold text."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14130 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14131 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14132 (set-buffer gnus-article-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14133 (let ((buffer-read-only nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14134 (while (search-forward "\b" nil t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14135 (let ((next (following-char))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14136 (previous (char-after (- (point) 2))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14137 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14138 ((eq next previous)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14139 (gnus-put-text-property (- (point) 2) (point) 'invisible t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14140 (gnus-put-text-property (point) (1+ (point)) 'face 'bold))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14141 ((eq next ?_)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14142 (gnus-put-text-property (1- (point)) (1+ (point)) 'invisible t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14143 (gnus-put-text-property
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14144 (- (point) 2) (1- (point)) 'face 'underline))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14145 ((eq previous ?_)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14146 (gnus-put-text-property (- (point) 2) (point) 'invisible t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14147 (gnus-put-text-property
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14148 (point) (1+ (point)) 'face 'underline))))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14149
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14150 (defun gnus-article-word-wrap ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14151 "Format too long lines."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14152 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14153 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14154 (set-buffer gnus-article-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14155 (let ((buffer-read-only nil))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14156 (widen)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14157 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14158 (search-forward "\n\n" nil t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14159 (end-of-line 1)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14160 (let ((paragraph-start "^[>|#:<;* ]*[ \t]*$")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14161 (adaptive-fill-regexp "[ \t]*\\([|#:<;>*]+ *\\)?")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14162 (adaptive-fill-mode t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14163 (while (not (eobp))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14164 (and (>= (current-column) (min fill-column (window-width)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14165 (/= (preceding-char) ?:)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14166 (fill-paragraph nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14167 (end-of-line 2))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14168
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14169 (defun gnus-article-remove-cr ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14170 "Remove carriage returns from an article."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14171 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14172 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14173 (set-buffer gnus-article-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14174 (let ((buffer-read-only nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14175 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14176 (while (search-forward "\r" nil t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14177 (replace-match "" t t)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14178
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14179 (defun gnus-article-remove-trailing-blank-lines ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14180 "Remove all trailing blank lines from the article."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14181 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14182 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14183 (set-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14184 (let ((buffer-read-only nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14185 (goto-char (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14186 (delete-region
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14187 (point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14188 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14189 (while (looking-at "^[ \t]*$")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14190 (forward-line -1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14191 (forward-line 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14192 (point))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14193
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14194 (defun gnus-article-display-x-face (&optional force)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14195 "Look for an X-Face header and display it if present."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14196 (interactive (list 'force))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14197 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14198 (set-buffer gnus-article-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14199 ;; Delete the old process, if any.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14200 (when (process-status "gnus-x-face")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14201 (delete-process "gnus-x-face"))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14202 (let ((inhibit-point-motion-hooks t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14203 (case-fold-search nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14204 from)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14205 (save-restriction
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14206 (nnheader-narrow-to-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14207 (setq from (message-fetch-field "from"))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14208 (goto-char (point-min))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14209 (when (and gnus-article-x-face-command
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14210 (or force
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14211 ;; Check whether this face is censored.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14212 (not gnus-article-x-face-too-ugly)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14213 (and gnus-article-x-face-too-ugly from
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14214 (not (string-match gnus-article-x-face-too-ugly
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14215 from))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14216 ;; Has to be present.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14217 (re-search-forward "^X-Face: " nil t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14218 ;; 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
14219 (let ((beg (point))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14220 (end (1- (re-search-forward "^\\($\\|[^ \t]\\)" nil t))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14221 ;; We display the face.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14222 (if (symbolp gnus-article-x-face-command)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14223 ;; The command is a lisp function, so we call it.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14224 (if (gnus-functionp gnus-article-x-face-command)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14225 (funcall gnus-article-x-face-command beg end)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14226 (error "%s is not a function" gnus-article-x-face-command))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14227 ;; The command is a string, so we interpret the command
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14228 ;; as a, well, command, and fork it off.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14229 (let ((process-connection-type nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14230 (process-kill-without-query
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14231 (start-process
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14232 "gnus-x-face" nil shell-file-name shell-command-switch
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14233 gnus-article-x-face-command))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14234 (process-send-region "gnus-x-face" beg end)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14235 (process-send-eof "gnus-x-face")))))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14236
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14237 (defalias 'gnus-headers-decode-quoted-printable 'gnus-decode-rfc1522)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14238 (defun gnus-decode-rfc1522 ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14239 "Hack to remove QP encoding from headers."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14240 (let ((case-fold-search t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14241 (inhibit-point-motion-hooks t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14242 (buffer-read-only nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14243 string)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14244 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14245 (narrow-to-region
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14246 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14247 (or (search-forward "\n\n" nil t) (point-max)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14248
15945
66d74ded252a 1996-08-27 Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15915
diff changeset
14249 (goto-char (point-min))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14250 (while (re-search-forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14251 "=\\?iso-8859-1\\?q\\?\\([^?\t\n]*\\)\\?=" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14252 (setq string (match-string 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14253 (narrow-to-region (match-beginning 0) (match-end 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14254 (delete-region (point-min) (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14255 (insert string)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14256 (gnus-mime-decode-quoted-printable (goto-char (point-min)) (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14257 (subst-char-in-region (point-min) (point-max) ?_ ? )
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14258 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14259 (goto-char (point-min))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14260
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14261 (defun gnus-article-de-quoted-unreadable (&optional force)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14262 "Do a naive translation of a quoted-printable-encoded article.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14263 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
14264 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
14265 written.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14266 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
14267 or not."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14268 (interactive (list 'force))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14269 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14270 (set-buffer gnus-article-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14271 (let ((case-fold-search t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14272 (buffer-read-only nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14273 (type (gnus-fetch-field "content-transfer-encoding")))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14274 (gnus-decode-rfc1522)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14275 (when (or force
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14276 (and type (string-match "quoted-printable" (downcase type))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14277 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14278 (search-forward "\n\n" nil 'move)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14279 (gnus-mime-decode-quoted-printable (point) (point-max))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14280
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14281 (defun gnus-mime-decode-quoted-printable (from to)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14282 "Decode Quoted-Printable in the region between FROM and TO."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14283 (interactive "r")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14284 (goto-char from)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14285 (while (search-forward "=" to t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14286 (cond ((eq (following-char) ?\n)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14287 (delete-char -1)
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 ((looking-at "[0-9A-F][0-9A-F]")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14290 (subst-char-in-region
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14291 (1- (point)) (point) ?=
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14292 (hexl-hex-string-to-integer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14293 (buffer-substring (point) (+ 2 (point)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14294 (delete-char 2))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14295 ((looking-at "=")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14296 (delete-char 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14297 ((gnus-message 3 "Malformed MIME quoted-printable message")))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14298
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14299 (defun gnus-article-hide-pgp (&optional arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14300 "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
14301 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
14302 always hide."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14303 (interactive (gnus-hidden-arg))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14304 (unless (gnus-article-check-hidden-text 'pgp arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14305 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14306 (set-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14307 (let ((props (nconc (list 'gnus-type 'pgp) gnus-hidden-properties))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14308 buffer-read-only beg end)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14309 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14310 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14311 ;; Hide the "header".
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14312 (and (search-forward "\n-----BEGIN PGP SIGNED MESSAGE-----\n" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14313 (gnus-hide-text (match-beginning 0) (match-end 0) props))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14314 (setq beg (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14315 ;; Hide the actual signature.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14316 (and (search-forward "\n-----BEGIN PGP SIGNATURE-----\n" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14317 (setq end (1+ (match-beginning 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14318 (gnus-hide-text
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14319 end
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14320 (if (search-forward "\n-----END PGP SIGNATURE-----\n" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14321 (match-end 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14322 ;; Perhaps we shouldn't hide to the end of the buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14323 ;; if there is no end to the signature?
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14324 (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14325 props))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14326 ;; Hide "- " PGP quotation markers.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14327 (when (and beg end)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14328 (narrow-to-region beg end)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14329 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14330 (while (re-search-forward "^- " nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14331 (gnus-hide-text (match-beginning 0) (match-end 0) props))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14332 (widen))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14333
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14334 (defun gnus-article-hide-signature (&optional arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14335 "Hide the signature in the current article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14336 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
14337 always hide."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14338 (interactive (gnus-hidden-arg))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14339 (unless (gnus-article-check-hidden-text 'signature arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14340 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14341 (set-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14342 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14343 (let ((buffer-read-only nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14344 (when (gnus-narrow-to-signature)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14345 (gnus-hide-text-type (point-min) (point-max) 'signature)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14346
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14347 (defun gnus-article-strip-leading-blank-lines ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14348 "Remove all blank lines from the beginning of the article."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14349 (interactive)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14350 (save-excursion
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14351 (set-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14352 (let (buffer-read-only)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14353 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14354 (when (search-forward "\n\n" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14355 (while (looking-at "[ \t]$")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14356 (gnus-delete-line))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14357
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14358 (defvar mime::preview/content-list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14359 (defvar mime::preview-content-info/point-min)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14360 (defun gnus-narrow-to-signature ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14361 "Narrow to the signature."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14362 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14363 (if (and (boundp 'mime::preview/content-list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14364 mime::preview/content-list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14365 (let ((pcinfo (car (last mime::preview/content-list))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14366 (condition-case ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14367 (narrow-to-region
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14368 (funcall (intern "mime::preview-content-info/point-min") pcinfo)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14369 (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14370 (error nil))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14371 (goto-char (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14372 (when (re-search-backward gnus-signature-separator nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14373 (forward-line 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14374 (when (or (null gnus-signature-limit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14375 (and (numberp gnus-signature-limit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14376 (< (- (point-max) (point)) gnus-signature-limit))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14377 (and (gnus-functionp gnus-signature-limit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14378 (funcall gnus-signature-limit))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14379 (and (stringp gnus-signature-limit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14380 (not (re-search-forward gnus-signature-limit nil t))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14381 (narrow-to-region (point) (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14382 t)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14383
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14384 (defun gnus-hidden-arg ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14385 "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
14386 (list (if current-prefix-arg
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14387 (prefix-numeric-value current-prefix-arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14388 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14389
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14390 (defun gnus-article-check-hidden-text (type arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14391 "Return nil if hiding is necessary.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14392 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
14393 means show, 0 means toggle."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14394 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14395 (set-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14396 (let ((hide (gnus-article-hidden-text-p type)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14397 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14398 ((or (null arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14399 (> arg 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14400 nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14401 ((< arg 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14402 (gnus-article-show-hidden-text type))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14403 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14404 (if (eq hide 'hidden)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14405 (gnus-article-show-hidden-text type)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14406 nil))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14407
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14408 (defun gnus-article-hidden-text-p (type)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14409 "Say whether the current buffer contains hidden text of type TYPE."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14410 (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
14411 (when pos
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14412 (if (get-text-property pos 'invisible)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14413 'hidden
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14414 'shown))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14415
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14416 (defun gnus-article-hide (&optional arg force)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14417 "Hide all the gruft in the current article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14418 This means that PGP stuff, signatures, cited text and (some)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14419 headers will be hidden.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14420 If given a prefix, show the hidden text instead."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14421 (interactive (list current-prefix-arg 'force))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14422 (gnus-article-hide-headers arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14423 (gnus-article-hide-pgp arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14424 (gnus-article-hide-citation-maybe arg force)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14425 (gnus-article-hide-signature arg))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14426
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14427 (defun gnus-article-show-hidden-text (type &optional hide)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14428 "Show all hidden text of type TYPE.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14429 If HIDE, hide the text instead."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14430 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14431 (set-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14432 (let ((buffer-read-only nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14433 (inhibit-point-motion-hooks t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14434 (beg (point-min)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14435 (while (gnus-goto-char (text-property-any
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14436 beg (point-max) 'gnus-type type))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14437 (setq beg (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14438 (forward-char)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14439 (if hide
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14440 (gnus-hide-text beg (point) gnus-hidden-properties)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14441 (gnus-unhide-text beg (point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14442 (setq beg (point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14443 t)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14444
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14445 (defvar gnus-article-time-units
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14446 `((year . ,(* 365.25 24 60 60))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14447 (week . ,(* 7 24 60 60))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14448 (day . ,(* 24 60 60))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14449 (hour . ,(* 60 60))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14450 (minute . 60)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14451 (second . 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14452 "Mapping from time units to seconds.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14453
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14454 (defun gnus-article-date-ut (&optional type highlight)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14455 "Convert DATE date to universal time in the current article.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14456 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
14457 how much time has lapsed since DATE."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14458 (interactive (list 'ut t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14459 (let* ((header (or gnus-current-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14460 (gnus-summary-article-header) ""))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14461 (date (and (vectorp header) (mail-header-date header)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14462 (date-regexp "^Date: \\|^X-Sent: ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14463 (now (current-time))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14464 (inhibit-point-motion-hooks t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14465 bface eface)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14466 (when (and date (not (string= date "")))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14467 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14468 (set-buffer gnus-article-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14469 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14470 (nnheader-narrow-to-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14471 (let ((buffer-read-only nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14472 ;; Delete any old Date headers.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14473 (if (re-search-forward date-regexp nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14474 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14475 (setq bface (get-text-property (gnus-point-at-bol) 'face)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14476 eface (get-text-property (1- (gnus-point-at-eol))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14477 'face))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14478 (message-remove-header date-regexp t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14479 (beginning-of-line))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14480 (goto-char (point-max)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14481 (insert (gnus-make-date-line date type))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14482 ;; Do highlighting.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14483 (forward-line -1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14484 (when (and (gnus-visual-p 'article-highlight 'highlight)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14485 (looking-at "\\([^:]+\\): *\\(.*\\)$"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14486 (gnus-put-text-property (match-beginning 1) (match-end 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14487 'face bface)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14488 (gnus-put-text-property (match-beginning 2) (match-end 2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14489 'face eface))))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14490
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14491 (defun gnus-make-date-line (date type)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14492 "Return a DATE line of TYPE."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14493 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14494 ;; Convert to the local timezone. We have to slap a
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14495 ;; `condition-case' round the calls to the timezone
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14496 ;; functions since they aren't particularly resistant to
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14497 ;; buggy dates.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14498 ((eq type 'local)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14499 (concat "Date: " (condition-case ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14500 (timezone-make-date-arpa-standard date)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14501 (error date))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14502 "\n"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14503 ;; Convert to Universal Time.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14504 ((eq type 'ut)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14505 (concat "Date: "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14506 (condition-case ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14507 (timezone-make-date-arpa-standard date nil "UT")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14508 (error date))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14509 "\n"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14510 ;; Get the original date from the article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14511 ((eq type 'original)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14512 (concat "Date: " date "\n"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14513 ;; Do an X-Sent lapsed format.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14514 ((eq type 'lapsed)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14515 ;; If the date is seriously mangled, the timezone
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14516 ;; functions are liable to bug out, so we condition-case
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14517 ;; the entire thing.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14518 (let* ((now (current-time))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14519 (real-time
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14520 (condition-case ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14521 (gnus-time-minus
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14522 (gnus-encode-date
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14523 (timezone-make-date-arpa-standard
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14524 (current-time-string now)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14525 (current-time-zone now) "UT"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14526 (gnus-encode-date
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14527 (timezone-make-date-arpa-standard
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14528 date nil "UT")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14529 (error '(0 0))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14530 (real-sec (+ (* (float (car real-time)) 65536)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14531 (cadr real-time)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14532 (sec (abs real-sec))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14533 num prev)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14534 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14535 ((equal real-time '(0 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14536 "X-Sent: Unknown\n")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14537 ((zerop sec)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14538 "X-Sent: Now\n")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14539 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14540 (concat
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14541 "X-Sent: "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14542 ;; This is a bit convoluted, but basically we go
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14543 ;; through the time units for years, weeks, etc,
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14544 ;; and divide things to see whether that results
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14545 ;; in positive answers.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14546 (mapconcat
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14547 (lambda (unit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14548 (if (zerop (setq num (ffloor (/ sec (cdr unit)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14549 ;; The (remaining) seconds are too few to
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14550 ;; be divided into this time unit.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14551 ""
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14552 ;; It's big enough, so we output it.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14553 (setq sec (- sec (* num (cdr unit))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14554 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14555 (concat (if prev ", " "") (int-to-string
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14556 (floor num))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14557 " " (symbol-name (car unit))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14558 (if (> num 1) "s" ""))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14559 (setq prev t))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14560 gnus-article-time-units "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14561 ;; If dates are odd, then it might appear like the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14562 ;; article was sent in the future.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14563 (if (> real-sec 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14564 " ago\n"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14565 " in the future\n"))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14566 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14567 (error "Unknown conversion type: %s" type))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14568
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14569 (defun gnus-article-date-local (&optional highlight)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14570 "Convert the current article date to the local timezone."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14571 (interactive (list t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14572 (gnus-article-date-ut 'local highlight))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14573
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14574 (defun gnus-article-date-original (&optional highlight)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14575 "Convert the current article date to what it was originally.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14576 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
14577 function and want to see what the date was before converting."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14578 (interactive (list t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14579 (gnus-article-date-ut 'original highlight))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14580
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14581 (defun gnus-article-date-lapsed (&optional highlight)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14582 "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
14583 (interactive (list t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14584 (gnus-article-date-ut 'lapsed highlight))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14585
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14586 (defun gnus-article-maybe-highlight ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14587 "Do some article highlighting if `gnus-visual' is non-nil."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14588 (if (gnus-visual-p 'article-highlight 'highlight)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14589 (gnus-article-highlight-some)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14590
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14591 ;;; Article savers.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14592
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14593 (defun gnus-output-to-rmail (file-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14594 "Append the current article to an Rmail file named FILE-NAME."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14595 (require 'rmail)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14596 ;; Most of these codes are borrowed from rmailout.el.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14597 (setq file-name (expand-file-name file-name))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14598 (setq rmail-default-rmail-file file-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14599 (let ((artbuf (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14600 (tmpbuf (get-buffer-create " *Gnus-output*")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14601 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14602 (or (get-file-buffer file-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14603 (file-exists-p file-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14604 (if (gnus-yes-or-no-p
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14605 (concat "\"" file-name "\" does not exist, create it? "))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14606 (let ((file-buffer (create-file-buffer file-name)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14607 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14608 (set-buffer file-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14609 (rmail-insert-rmail-file-header)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14610 (let ((require-final-newline nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14611 (write-region (point-min) (point-max) file-name t 1)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14612 (kill-buffer file-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14613 (error "Output file does not exist")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14614 (set-buffer tmpbuf)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14615 (buffer-disable-undo (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14616 (erase-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14617 (insert-buffer-substring artbuf)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14618 (gnus-convert-article-to-rmail)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14619 ;; 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
14620 (let ((outbuf (get-file-buffer file-name)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14621 (if (not outbuf)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14622 (append-to-file (point-min) (point-max) file-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14623 ;; File has been visited, in buffer OUTBUF.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14624 (set-buffer outbuf)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14625 (let ((buffer-read-only nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14626 (msg (and (boundp 'rmail-current-message)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14627 (symbol-value 'rmail-current-message))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14628 ;; If MSG is non-nil, buffer is in RMAIL mode.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14629 (if msg
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14630 (progn (widen)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14631 (narrow-to-region (point-max) (point-max))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14632 (insert-buffer-substring tmpbuf)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14633 (if msg
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14634 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14635 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14636 (widen)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14637 (search-backward "\^_")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14638 (narrow-to-region (point) (point-max))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14639 (goto-char (1+ (point-min)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14640 (rmail-count-new-messages t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14641 (rmail-show-message msg)))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14642 (kill-buffer tmpbuf)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14643
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14644 (defun gnus-output-to-file (file-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14645 "Append the current article to a file named FILE-NAME."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14646 (let ((artbuf (current-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14647 (nnheader-temp-write nil
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14648 (insert-buffer-substring artbuf)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14649 ;; Append newline at end of the buffer as separator, and then
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14650 ;; save it to file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14651 (goto-char (point-max))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14652 (insert "\n")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14653 (append-to-file (point-min) (point-max) file-name))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14654
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14655 (defun gnus-convert-article-to-rmail ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14656 "Convert article in current buffer to Rmail message format."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14657 (let ((buffer-read-only nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14658 ;; Convert article directly into Babyl format.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14659 ;; Suggested by Rob Austein <sra@lcs.mit.edu>
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14660 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14661 (insert "\^L\n0, unseen,,\n*** EOOH ***\n")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14662 (while (search-forward "\n\^_" nil t) ;single char
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14663 (replace-match "\n^_" t t)) ;2 chars: "^" and "_"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14664 (goto-char (point-max))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14665 (insert "\^_")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14666
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14667 (defun gnus-narrow-to-page (&optional arg)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14668 "Narrow the article buffer to a page.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14669 If given a numerical ARG, move forward ARG pages."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14670 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14671 (setq arg (if arg (prefix-numeric-value arg) 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14672 (save-excursion
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14673 (set-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14674 (goto-char (point-min))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14675 (widen)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14676 (when (gnus-visual-p 'page-marker)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14677 (let ((buffer-read-only nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14678 (gnus-remove-text-with-property 'gnus-prev)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14679 (gnus-remove-text-with-property 'gnus-next)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14680 (when
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14681 (cond ((< arg 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14682 (re-search-backward page-delimiter nil 'move (1+ (abs arg))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14683 ((> arg 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14684 (re-search-forward page-delimiter nil 'move arg)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14685 (goto-char (match-end 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14686 (narrow-to-region
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14687 (point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14688 (if (re-search-forward page-delimiter nil 'move)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14689 (match-beginning 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14690 (point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14691 (when (and (gnus-visual-p 'page-marker)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14692 (not (= (point-min) 1)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14693 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14694 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14695 (gnus-insert-prev-page-button)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14696 (when (and (gnus-visual-p 'page-marker)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14697 (not (= (1- (point-max)) (buffer-size))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14698 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14699 (goto-char (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14700 (gnus-insert-next-page-button)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14701
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14702 ;; Article mode commands
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14703
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14704 (defun gnus-article-goto-next-page ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14705 "Show the next page of the article."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14706 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14707 (when (gnus-article-next-page)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14708 (gnus-article-read-summary-keys nil (gnus-character-to-event ?n))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14709
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14710 (defun gnus-article-goto-prev-page ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14711 "Show the next page of the article."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14712 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14713 (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
14714 (gnus-article-prev-page nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14715
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14716 (defun gnus-article-next-page (&optional lines)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14717 "Show the next page of the current article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14718 If end of article, return non-nil. Otherwise return nil.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14719 Argument LINES specifies lines to be scrolled up."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14720 (interactive "p")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14721 (move-to-window-line -1)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14722 ;; Fixed by enami@ptgd.sony.co.jp (enami tsugutomo)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14723 (if (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14724 (end-of-line)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14725 (and (pos-visible-in-window-p) ;Not continuation line.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14726 (eobp)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14727 ;; Nothing in this page.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14728 (if (or (not gnus-break-pages)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14729 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14730 (save-restriction
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14731 (widen) (forward-line 1) (eobp)))) ;Real end-of-buffer?
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14732 t ;Nothing more.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14733 (gnus-narrow-to-page 1) ;Go to next page.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14734 nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14735 ;; More in this page.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14736 (condition-case ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14737 (scroll-up lines)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14738 (end-of-buffer
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14739 ;; Long lines may cause an end-of-buffer error.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14740 (goto-char (point-max))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14741 (move-to-window-line 0)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14742 nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14743
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14744 (defun gnus-article-prev-page (&optional lines)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14745 "Show previous page of current article.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14746 Argument LINES specifies lines to be scrolled down."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14747 (interactive "p")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14748 (move-to-window-line 0)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14749 (if (and gnus-break-pages
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14750 (bobp)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14751 (not (save-restriction (widen) (bobp)))) ;Real beginning-of-buffer?
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14752 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14753 (gnus-narrow-to-page -1) ;Go to previous page.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14754 (goto-char (point-max))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14755 (recenter -1))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14756 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14757 (condition-case ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14758 (scroll-down lines)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14759 (error nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14760 (move-to-window-line 0))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14761
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14762 (defun gnus-article-refer-article ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14763 "Read article specified by message-id around point."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14764 (interactive)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14765 (let ((point (point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14766 (search-forward ">" nil t) ;Move point to end of "<....>".
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14767 (if (re-search-backward "\\(<[^<> \t\n]+>\\)" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14768 (let ((message-id (match-string 1)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14769 (goto-char point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14770 (set-buffer gnus-summary-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14771 (gnus-summary-refer-article message-id))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14772 (goto-char (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14773 (error "No references around point"))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14774
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14775 (defun gnus-article-show-summary ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14776 "Reconfigure windows to show summary buffer."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14777 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14778 (gnus-configure-windows 'article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14779 (gnus-summary-goto-subject gnus-current-article))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14780
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14781 (defun gnus-article-describe-briefly ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14782 "Describe article mode commands briefly."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14783 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14784 (gnus-message 6
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
14785 (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
14786
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14787 (defun gnus-article-summary-command ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14788 "Execute the last keystroke in the summary buffer."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14789 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14790 (let ((obuf (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14791 (owin (current-window-configuration))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14792 func)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14793 (switch-to-buffer gnus-summary-buffer 'norecord)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14794 (setq func (lookup-key (current-local-map) (this-command-keys)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14795 (call-interactively func)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14796 (set-buffer obuf)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14797 (set-window-configuration owin)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14798 (set-window-point (get-buffer-window (current-buffer)) (point))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14799
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14800 (defun gnus-article-summary-command-nosave ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14801 "Execute the last keystroke in the summary buffer."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14802 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14803 (let (func)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14804 (pop-to-buffer gnus-summary-buffer 'norecord)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14805 (setq func (lookup-key (current-local-map) (this-command-keys)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14806 (call-interactively func)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14807
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14808 (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
14809 "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
14810 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14811 (let ((nosaves
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14812 '("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
14813 "Zc" "ZC" "ZE" "ZQ" "ZZ" "Zn" "ZR" "ZG" "ZN" "ZP"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14814 "=" "^" "\M-^" "|"))
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
14815 (nosave-but-article
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
14816 '("A\r"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14817 keys)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14818 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14819 (set-buffer gnus-summary-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14820 (push (or key last-command-event) unread-command-events)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14821 (setq keys (read-key-sequence nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14822 (message "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14823
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
14824 (if (or (member keys nosaves)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
14825 (member keys nosave-but-article))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14826 (let (func)
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
14827 (save-window-excursion
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
14828 (pop-to-buffer gnus-summary-buffer 'norecord)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
14829 (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
14830 (if (not func)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
14831 (ding)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
14832 (set-buffer gnus-summary-buffer)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
14833 (call-interactively func))
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
14834 (when (member keys nosave-but-article)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
14835 (pop-to-buffer gnus-article-buffer 'norecord)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14836 (let ((obuf (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14837 (owin (current-window-configuration))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14838 (opoint (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14839 func in-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14840 (if not-restore-window
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14841 (pop-to-buffer gnus-summary-buffer 'norecord)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14842 (switch-to-buffer gnus-summary-buffer 'norecord))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14843 (setq in-buffer (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14844 (if (setq func (lookup-key (current-local-map) keys))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14845 (call-interactively func)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14846 (ding))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14847 (when (eq in-buffer (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14848 (set-buffer obuf)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14849 (unless not-restore-window
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14850 (set-window-configuration owin))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14851 (set-window-point (get-buffer-window (current-buffer)) opoint))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14852
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14853
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14854 ;;;
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14855 ;;; Kill file handling.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14856 ;;;
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14857
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14858 ;;;###autoload
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14859 (defalias 'gnus-batch-kill 'gnus-batch-score)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14860 ;;;###autoload
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14861 (defun gnus-batch-score ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14862 "Run batched scoring.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14863 Usage: emacs -batch -l gnus -f gnus-batch-score <newsgroups> ...
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14864 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
14865 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
14866 score the alt hierarchy, you'd say \"!alt.all\"."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14867 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14868 (let* ((yes-and-no
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14869 (gnus-newsrc-parse-options
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14870 (apply (function concat)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14871 (mapcar (lambda (g) (concat g " "))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14872 command-line-args-left))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14873 (gnus-expert-user t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14874 (nnmail-spool-file nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14875 (gnus-use-dribble-file nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14876 (yes (car yes-and-no))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14877 (no (cdr yes-and-no))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14878 group newsrc entry
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14879 ;; Disable verbose message.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14880 gnus-novice-user gnus-large-newsgroup)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14881 ;; Eat all arguments.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14882 (setq command-line-args-left nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14883 ;; Start Gnus.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14884 (gnus)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14885 ;; Apply kills to specified newsgroups in command line arguments.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14886 (setq newsrc (cdr gnus-newsrc-alist))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14887 (while newsrc
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14888 (setq group (caar newsrc))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14889 (setq entry (gnus-gethash group gnus-newsrc-hashtb))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14890 (if (and (<= (nth 1 (car newsrc)) gnus-level-subscribed)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14891 (and (car entry)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14892 (or (eq (car entry) t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14893 (not (zerop (car entry)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14894 (if yes (string-match yes group) t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14895 (or (null no) (not (string-match no group))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14896 (progn
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14897 (gnus-summary-read-group group nil t nil t)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14898 (and (eq (current-buffer) (get-buffer gnus-summary-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14899 (gnus-summary-exit))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14900 (setq newsrc (cdr newsrc)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14901 ;; Exit Emacs.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14902 (switch-to-buffer gnus-group-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14903 (gnus-group-save-newsrc)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14904
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14905 (defun gnus-apply-kill-file ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14906 "Apply a kill file to the current newsgroup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14907 Returns the number of articles marked as read."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14908 (if (or (file-exists-p (gnus-newsgroup-kill-file nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14909 (file-exists-p (gnus-newsgroup-kill-file gnus-newsgroup-name)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14910 (gnus-apply-kill-file-internal)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14911 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14912
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14913 (defun gnus-kill-save-kill-buffer ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14914 (let ((file (gnus-newsgroup-kill-file gnus-newsgroup-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14915 (when (get-file-buffer file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14916 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14917 (set-buffer (get-file-buffer file))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14918 (and (buffer-modified-p) (save-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14919 (kill-buffer (current-buffer))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14920
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14921 (defvar gnus-kill-file-name "KILL"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14922 "Suffix of the kill files.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14923
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14924 (defun gnus-newsgroup-kill-file (newsgroup)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14925 "Return the name of a kill file name for NEWSGROUP.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14926 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
14927 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14928 ;; The global KILL file is placed at top of the directory.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14929 ((or (null newsgroup)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14930 (string-equal newsgroup ""))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14931 (expand-file-name gnus-kill-file-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14932 gnus-kill-files-directory))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14933 ;; Append ".KILL" to newsgroup name.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14934 ((gnus-use-long-file-name 'not-kill)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14935 (expand-file-name (concat (gnus-newsgroup-savable-name newsgroup)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14936 "." gnus-kill-file-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14937 gnus-kill-files-directory))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14938 ;; Place "KILL" under the hierarchical directory.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14939 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14940 (expand-file-name (concat (gnus-newsgroup-directory-form newsgroup)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14941 "/" gnus-kill-file-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14942 gnus-kill-files-directory))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14943
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 ;;; Dribble file
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14947 ;;;
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 (defvar gnus-dribble-ignore nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14950 (defvar gnus-dribble-eval-file nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14951
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14952 (defun gnus-dribble-file-name ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14953 "Return the dribble file for the current .newsrc."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14954 (concat
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14955 (if gnus-dribble-directory
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14956 (concat (file-name-as-directory gnus-dribble-directory)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14957 (file-name-nondirectory gnus-current-startup-file))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14958 gnus-current-startup-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14959 "-dribble"))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14960
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14961 (defun gnus-dribble-enter (string)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14962 "Enter STRING into the dribble buffer."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14963 (if (and (not gnus-dribble-ignore)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14964 gnus-dribble-buffer
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14965 (buffer-name gnus-dribble-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14966 (let ((obuf (current-buffer)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14967 (set-buffer gnus-dribble-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14968 (insert string "\n")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14969 (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
14970 (bury-buffer gnus-dribble-buffer)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14971 (set-buffer obuf))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14972
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14973 (defun gnus-dribble-read-file ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14974 "Read the dribble file from disk."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14975 (let ((dribble-file (gnus-dribble-file-name)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14976 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14977 (set-buffer (setq gnus-dribble-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14978 (get-buffer-create
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14979 (file-name-nondirectory dribble-file))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14980 (gnus-add-current-to-buffer-list)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14981 (erase-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14982 (setq buffer-file-name dribble-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14983 (auto-save-mode t)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14984 (buffer-disable-undo (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14985 (bury-buffer (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14986 (set-buffer-modified-p nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14987 (let ((auto (make-auto-save-file-name))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14988 (gnus-dribble-ignore t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14989 modes)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14990 (when (or (file-exists-p auto) (file-exists-p dribble-file))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14991 ;; Load whichever file is newest -- the auto save file
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14992 ;; or the "real" file.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14993 (if (file-newer-than-file-p auto dribble-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14994 (insert-file-contents auto)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14995 (insert-file-contents dribble-file))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14996 (unless (zerop (buffer-size))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14997 (set-buffer-modified-p t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14998 ;; Set the file modes to reflect the .newsrc file modes.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14999 (save-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15000 (when (and (file-exists-p gnus-current-startup-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15001 (setq modes (file-modes gnus-current-startup-file)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15002 (set-file-modes dribble-file modes))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15003 ;; Possibly eval the file later.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15004 (when (gnus-y-or-n-p
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15005 "Auto-save file exists. Do you want to read it? ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15006 (setq gnus-dribble-eval-file t)))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15007
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15008 (defun gnus-dribble-eval-file ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15009 (when gnus-dribble-eval-file
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15010 (setq gnus-dribble-eval-file nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15011 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15012 (let ((gnus-dribble-ignore t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15013 (set-buffer gnus-dribble-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15014 (eval-buffer (current-buffer))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15015
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15016 (defun gnus-dribble-delete-file ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15017 (when (file-exists-p (gnus-dribble-file-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15018 (delete-file (gnus-dribble-file-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15019 (when gnus-dribble-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15020 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15021 (set-buffer gnus-dribble-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15022 (let ((auto (make-auto-save-file-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15023 (if (file-exists-p auto)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15024 (delete-file auto))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15025 (erase-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15026 (set-buffer-modified-p nil)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15027
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15028 (defun gnus-dribble-save ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15029 (when (and gnus-dribble-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15030 (buffer-name gnus-dribble-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15031 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15032 (set-buffer gnus-dribble-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15033 (save-buffer))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15034
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15035 (defun gnus-dribble-clear ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15036 (when (gnus-buffer-exists-p gnus-dribble-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15037 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15038 (set-buffer gnus-dribble-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15039 (erase-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15040 (set-buffer-modified-p nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15041 (setq buffer-saved-size (buffer-size)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15042
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15043
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15044 ;;;
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15045 ;;; Server Communication
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15046 ;;;
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 (defun gnus-start-news-server (&optional confirm)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15049 "Open a method for getting news.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15050 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
15051 (let (how)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15052 (if gnus-current-select-method
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15053 ;; Stream is already opened.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15054 nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15055 ;; Open NNTP server.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15056 (if (null gnus-nntp-service) (setq gnus-nntp-server nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15057 (if confirm
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15058 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15059 ;; Read server name with completion.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15060 (setq gnus-nntp-server
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15061 (completing-read "NNTP server: "
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15062 (mapcar (lambda (server) (list server))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15063 (cons (list gnus-nntp-server)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15064 gnus-secondary-servers))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15065 nil nil gnus-nntp-server))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15066
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15067 (if (and gnus-nntp-server
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15068 (stringp gnus-nntp-server)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15069 (not (string= gnus-nntp-server "")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15070 (setq gnus-select-method
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15071 (cond ((or (string= gnus-nntp-server "")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15072 (string= gnus-nntp-server "::"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15073 (list 'nnspool (system-name)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15074 ((string-match "^:" gnus-nntp-server)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15075 (list 'nnmh gnus-nntp-server
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15076 (list 'nnmh-directory
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15077 (file-name-as-directory
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15078 (expand-file-name
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15079 (concat "~/" (substring
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15080 gnus-nntp-server 1)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15081 (list 'nnmh-get-new-mail nil)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15082 (t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15083 (list 'nntp gnus-nntp-server)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15084
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15085 (setq how (car gnus-select-method))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15086 (cond ((eq how 'nnspool)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15087 (require 'nnspool)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15088 (gnus-message 5 "Looking up local news spool..."))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15089 ((eq how 'nnmh)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15090 (require 'nnmh)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15091 (gnus-message 5 "Looking up mh spool..."))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15092 (t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15093 (require 'nntp)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15094 (setq gnus-current-select-method gnus-select-method)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15095 (run-hooks 'gnus-open-server-hook)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15096 (or
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15097 ;; gnus-open-server-hook might have opened it
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15098 (gnus-server-opened gnus-select-method)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15099 (gnus-open-server gnus-select-method)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15100 (gnus-y-or-n-p
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15101 (format
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15102 "%s (%s) open error: '%s'. Continue? "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15103 (car gnus-select-method) (cadr gnus-select-method)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15104 (gnus-status-message gnus-select-method)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15105 (gnus-error 1 "Couldn't open server on %s"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15106 (nth 1 gnus-select-method))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15107
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15108 (defun gnus-check-group (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15109 "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
15110 (let ((method (gnus-find-method-for-group group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15111 (or (gnus-server-opened method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15112 (gnus-open-server method))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15113
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15114 (defun gnus-check-server (&optional method silent)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15115 "Check whether the connection to METHOD is down.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15116 If METHOD is nil, use `gnus-select-method'.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15117 If it is down, start it up (again)."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15118 (let ((method (or method gnus-select-method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15119 ;; Transform virtual server names into select methods.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15120 (when (stringp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15121 (setq method (gnus-server-to-method method)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15122 (if (gnus-server-opened method)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15123 ;; The stream is already opened.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15124 t
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15125 ;; Open the server.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15126 (unless silent
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15127 (gnus-message 5 "Opening %s server%s..." (car method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15128 (if (equal (nth 1 method) "") ""
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15129 (format " on %s" (nth 1 method)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15130 (run-hooks 'gnus-open-server-hook)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15131 (prog1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15132 (gnus-open-server method)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15133 (unless silent
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15134 (message ""))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15135
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15136 (defun gnus-get-function (method function &optional noerror)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15137 "Return a function symbol based on METHOD and FUNCTION."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15138 ;; Translate server names into methods.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15139 (unless method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15140 (error "Attempted use of a nil select method"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15141 (when (stringp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15142 (setq method (gnus-server-to-method method)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15143 (let ((func (intern (format "%s-%s" (car method) function))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15144 ;; If the functions isn't bound, we require the backend in
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15145 ;; question.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15146 (unless (fboundp func)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15147 (require (car method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15148 (when (and (not (fboundp func))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15149 (not noerror))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15150 ;; This backend doesn't implement this function.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15151 (error "No such function: %s" func)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15152 func))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15153
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15154
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15155 ;;;
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15156 ;;; Interface functions to the backends.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15157 ;;;
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15158
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15159 (defun gnus-open-server (method)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15160 "Open a connection to METHOD."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15161 (when (stringp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15162 (setq method (gnus-server-to-method method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15163 (let ((elem (assoc method gnus-opened-servers)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15164 ;; If this method was previously denied, we just return nil.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15165 (if (eq (nth 1 elem) 'denied)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15166 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15167 (gnus-message 1 "Denied server")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15168 nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15169 ;; Open the server.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15170 (let ((result
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15171 (funcall (gnus-get-function method 'open-server)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15172 (nth 1 method) (nthcdr 2 method))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15173 ;; 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
15174 (unless elem
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15175 (setq elem (list method nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15176 gnus-opened-servers (cons elem gnus-opened-servers)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15177 ;; Set the status of this server.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15178 (setcar (cdr elem) (if result 'ok 'denied))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15179 ;; Return the result from the "open" call.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15180 result))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15181
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15182 (defun gnus-close-server (method)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15183 "Close the connection to METHOD."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15184 (when (stringp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15185 (setq method (gnus-server-to-method method)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15186 (funcall (gnus-get-function method 'close-server) (nth 1 method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15187
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15188 (defun gnus-request-list (method)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15189 "Request the active file from METHOD."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15190 (when (stringp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15191 (setq method (gnus-server-to-method method)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15192 (funcall (gnus-get-function method 'request-list) (nth 1 method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15193
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15194 (defun gnus-request-list-newsgroups (method)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15195 "Request the newsgroups file from METHOD."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15196 (when (stringp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15197 (setq method (gnus-server-to-method method)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15198 (funcall (gnus-get-function method 'request-list-newsgroups) (nth 1 method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15199
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15200 (defun gnus-request-newgroups (date method)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15201 "Request all new groups since DATE from METHOD."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15202 (when (stringp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15203 (setq method (gnus-server-to-method method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15204 (funcall (gnus-get-function method 'request-newgroups)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15205 date (nth 1 method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15206
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15207 (defun gnus-server-opened (method)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15208 "Check whether a connection to METHOD has been opened."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15209 (when (stringp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15210 (setq method (gnus-server-to-method method)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15211 (funcall (gnus-get-function method 'server-opened) (nth 1 method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15212
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15213 (defun gnus-status-message (method)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15214 "Return the status message from METHOD.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15215 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
15216 this group uses will be queried."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15217 (let ((method (if (stringp method) (gnus-find-method-for-group method)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15218 method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15219 (funcall (gnus-get-function method 'status-message) (nth 1 method))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15220
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15221 (defun gnus-request-group (group &optional dont-check method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15222 "Request GROUP. If DONT-CHECK, no information is required."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15223 (let ((method (or method (gnus-find-method-for-group group))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15224 (when (stringp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15225 (setq method (gnus-server-to-method method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15226 (funcall (gnus-get-function method 'request-group)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15227 (gnus-group-real-name group) (nth 1 method) dont-check)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15228
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15229 (defun gnus-request-asynchronous (group &optional articles)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15230 "Request that GROUP behave asynchronously.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15231 ARTICLES is the `data' of the group."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15232 (let ((method (gnus-find-method-for-group group)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15233 (funcall (gnus-get-function method 'request-asynchronous)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15234 (gnus-group-real-name group) (nth 1 method) articles)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15235
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15236 (defun gnus-list-active-group (group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15237 "Request active information on GROUP."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15238 (let ((method (gnus-find-method-for-group group))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15239 (func 'list-active-group))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15240 (when (gnus-check-backend-function func group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15241 (funcall (gnus-get-function method func)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15242 (gnus-group-real-name group) (nth 1 method)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15243
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15244 (defun gnus-request-group-description (group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15245 "Request a description of GROUP."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15246 (let ((method (gnus-find-method-for-group group))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15247 (func 'request-group-description))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15248 (when (gnus-check-backend-function func group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15249 (funcall (gnus-get-function method func)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15250 (gnus-group-real-name group) (nth 1 method)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15251
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15252 (defun gnus-close-group (group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15253 "Request the GROUP be closed."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15254 (let ((method (gnus-find-method-for-group group)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15255 (funcall (gnus-get-function method 'close-group)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15256 (gnus-group-real-name group) (nth 1 method))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15257
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15258 (defun gnus-retrieve-headers (articles group &optional fetch-old)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15259 "Request headers for ARTICLES in GROUP.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15260 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
15261 (let ((method (gnus-find-method-for-group group)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15262 (if (and gnus-use-cache (numberp (car articles)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15263 (gnus-cache-retrieve-headers articles group fetch-old)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15264 (funcall (gnus-get-function method 'retrieve-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15265 articles (gnus-group-real-name group) (nth 1 method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15266 fetch-old))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15267
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15268 (defun gnus-retrieve-groups (groups method)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15269 "Request active information on GROUPS from METHOD."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15270 (when (stringp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15271 (setq method (gnus-server-to-method method)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15272 (funcall (gnus-get-function method 'retrieve-groups) groups (nth 1 method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15273
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15274 (defun gnus-request-type (group &optional article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15275 "Return the type (`post' or `mail') of GROUP (and ARTICLE)."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15276 (let ((method (gnus-find-method-for-group group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15277 (if (not (gnus-check-backend-function 'request-type (car method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15278 'unknown
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15279 (funcall (gnus-get-function method 'request-type)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15280 (gnus-group-real-name group) article))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15281
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15282 (defun gnus-request-update-mark (group article mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15283 "Return the type (`post' or `mail') of GROUP (and ARTICLE)."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15284 (let ((method (gnus-find-method-for-group group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15285 (if (not (gnus-check-backend-function 'request-update-mark (car method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15286 mark
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15287 (funcall (gnus-get-function method 'request-update-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15288 (gnus-group-real-name group) article mark))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15289
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15290 (defun gnus-request-article (article group &optional buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15291 "Request the ARTICLE in GROUP.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15292 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
15293 If BUFFER, insert the article in that group."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15294 (let ((method (gnus-find-method-for-group group)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15295 (funcall (gnus-get-function method 'request-article)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15296 article (gnus-group-real-name group) (nth 1 method) buffer)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15297
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15298 (defun gnus-request-head (article group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15299 "Request the head of ARTICLE in GROUP."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15300 (let* ((method (gnus-find-method-for-group group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15301 (head (gnus-get-function method 'request-head t)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15302 (if (fboundp head)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15303 (funcall head article (gnus-group-real-name group) (nth 1 method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15304 (let ((res (gnus-request-article article group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15305 (when res
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15306 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15307 (set-buffer nntp-server-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15308 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15309 (when (search-forward "\n\n" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15310 (delete-region (1- (point)) (point-max)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15311 (nnheader-fold-continuation-lines)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15312 res))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15313
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15314 (defun gnus-request-body (article group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15315 "Request the body of ARTICLE in GROUP."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15316 (let ((method (gnus-find-method-for-group group)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15317 (funcall (gnus-get-function method 'request-body)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15318 article (gnus-group-real-name group) (nth 1 method))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15319
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15320 (defun gnus-request-post (method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15321 "Post the current buffer using METHOD."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15322 (when (stringp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15323 (setq method (gnus-server-to-method method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15324 (funcall (gnus-get-function method 'request-post) (nth 1 method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15325
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15326 (defun gnus-request-scan (group method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15327 "Request a SCAN being performed in GROUP from METHOD.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15328 If GROUP is nil, all groups on METHOD are scanned."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15329 (let ((method (if group (gnus-find-method-for-group group) method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15330 (funcall (gnus-get-function method 'request-scan)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15331 (and group (gnus-group-real-name group)) (nth 1 method))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15332
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15333 (defsubst gnus-request-update-info (info method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15334 "Request that METHOD update INFO."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15335 (when (stringp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15336 (setq method (gnus-server-to-method method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15337 (when (gnus-check-backend-function 'request-update-info (car method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15338 (funcall (gnus-get-function method 'request-update-info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15339 (gnus-group-real-name (gnus-info-group info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15340 info (nth 1 method))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15341
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15342 (defun gnus-request-expire-articles (articles group &optional force)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15343 (let ((method (gnus-find-method-for-group group)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15344 (funcall (gnus-get-function method 'request-expire-articles)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15345 articles (gnus-group-real-name group) (nth 1 method)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15346 force)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15347
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15348 (defun gnus-request-move-article
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15349 (article group server accept-function &optional last)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15350 (let ((method (gnus-find-method-for-group group)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15351 (funcall (gnus-get-function method 'request-move-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15352 article (gnus-group-real-name group)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15353 (nth 1 method) accept-function last)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15354
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15355 (defun gnus-request-accept-article (group method &optional last)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15356 ;; 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
15357 (when (stringp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15358 (setq method (gnus-server-to-method method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15359 (when (and (not method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15360 (stringp group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15361 (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
15362 (goto-char (point-max))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15363 (unless (bolp)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15364 (insert "\n"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15365 (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
15366 (funcall (intern (format "%s-request-accept-article" func))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15367 (if (stringp group) (gnus-group-real-name group) group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15368 (cadr method)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15369 last)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15370
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15371 (defun gnus-request-replace-article (article group buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15372 (let ((func (car (gnus-find-method-for-group group))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15373 (funcall (intern (format "%s-request-replace-article" func))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15374 article (gnus-group-real-name group) buffer)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15375
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15376 (defun gnus-request-associate-buffer (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15377 (let ((method (gnus-find-method-for-group group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15378 (funcall (gnus-get-function method 'request-associate-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15379 (gnus-group-real-name group))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15380
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15381 (defun gnus-request-restore-buffer (article group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15382 "Request a new buffer restored to the state of ARTICLE."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15383 (let ((method (gnus-find-method-for-group group)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15384 (funcall (gnus-get-function method 'request-restore-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15385 article (gnus-group-real-name group) (nth 1 method))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15386
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15387 (defun gnus-request-create-group (group &optional method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15388 (when (stringp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15389 (setq method (gnus-server-to-method method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15390 (let ((method (or method (gnus-find-method-for-group group))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15391 (funcall (gnus-get-function method 'request-create-group)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15392 (gnus-group-real-name group) (nth 1 method))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15393
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15394 (defun gnus-request-delete-group (group &optional force)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15395 (let ((method (gnus-find-method-for-group group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15396 (funcall (gnus-get-function method 'request-delete-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15397 (gnus-group-real-name group) force (nth 1 method))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15398
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15399 (defun gnus-request-rename-group (group new-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15400 (let ((method (gnus-find-method-for-group group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15401 (funcall (gnus-get-function method 'request-rename-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15402 (gnus-group-real-name group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15403 (gnus-group-real-name new-name) (nth 1 method))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15404
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15405 (defun gnus-member-of-valid (symbol group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15406 "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
15407 (memq symbol (assoc
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15408 (symbol-name (car (gnus-find-method-for-group group)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15409 gnus-valid-select-methods)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15410
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15411 (defun gnus-method-option-p (method option)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15412 "Return non-nil if select METHOD has OPTION as a parameter."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15413 (when (stringp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15414 (setq method (gnus-server-to-method method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15415 (memq option (assoc (format "%s" (car method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15416 gnus-valid-select-methods)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15417
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15418 (defun gnus-server-extend-method (group method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15419 ;; This function "extends" a virtual server. If the server is
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15420 ;; "hello", and the select method is ("hello" (my-var "something"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15421 ;; 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
15422 ;; called "hello+alt.alt".
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15423 (let ((entry
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15424 (gnus-copy-sequence
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15425 (if (equal (car method) "native") gnus-select-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15426 (cdr (assoc (car method) gnus-server-alist))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15427 (setcar (cdr entry) (concat (nth 1 entry) "+" group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15428 (nconc entry (cdr method))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15429
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
15430 (defun gnus-server-status (method)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
15431 "Return the status of METHOD."
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
15432 (nth 1 (assoc method gnus-opened-servers)))
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
15433
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15434 (defun gnus-group-name-to-method (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15435 "Return a select method suitable for GROUP."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15436 (if (string-match ":" group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15437 (let ((server (substring group 0 (match-beginning 0))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15438 (if (string-match "\\+" server)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15439 (list (intern (substring server 0 (match-beginning 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15440 (substring server (match-end 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15441 (list (intern server) "")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15442 gnus-select-method))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15443
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15444 (defun gnus-find-method-for-group (group &optional info)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15445 "Find the select method that GROUP uses."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15446 (or gnus-override-method
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15447 (and (not group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15448 gnus-select-method)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15449 (let ((info (or info (gnus-get-info group)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15450 method)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15451 (if (or (not info)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15452 (not (setq method (gnus-info-method info)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15453 (equal method "native"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15454 gnus-select-method
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15455 (setq method
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15456 (cond ((stringp method)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15457 (gnus-server-to-method method))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15458 ((stringp (car method))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15459 (gnus-server-extend-method group method))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15460 (t
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15461 method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15462 (cond ((equal (cadr method) "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15463 method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15464 ((null (cadr method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15465 (list (car method) ""))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15466 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15467 (gnus-server-add-address method)))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15468
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15469 (defun gnus-check-backend-function (func group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15470 "Check whether GROUP supports function FUNC."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15471 (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
15472 group)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15473 (fboundp (intern (format "%s-%s" method func)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15474
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15475 (defun gnus-methods-using (feature)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15476 "Find all methods that have FEATURE."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15477 (let ((valids gnus-valid-select-methods)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15478 outs)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15479 (while valids
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15480 (if (memq feature (car valids))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15481 (setq outs (cons (car valids) outs)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15482 (setq valids (cdr valids)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15483 outs))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15484
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15485
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15486 ;;;
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15487 ;;; Active & Newsrc File Handling
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15488 ;;;
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15489
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15490 (defun gnus-setup-news (&optional rawfile level dont-connect)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15491 "Setup news information.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15492 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
15493 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
15494 (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
15495
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15496 (when init
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15497 ;; Clear some variables to re-initialize news information.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15498 (setq gnus-newsrc-alist nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15499 gnus-active-hashtb nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15500 ;; Read the newsrc file and create `gnus-newsrc-hashtb'.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15501 (gnus-read-newsrc-file rawfile))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15502
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15503 (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
15504 (gnus-archive-server-wanted-p))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15505 (push (cons "archive" gnus-message-archive-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15506 gnus-server-alist))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15507
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15508 ;; 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
15509 ;; hashtb here.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15510 (if (or (null gnus-read-active-file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15511 (eq gnus-read-active-file 'some))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15512 (gnus-update-active-hashtb-from-killed))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15513
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15514 ;; Read the active file and create `gnus-active-hashtb'.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15515 ;; 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
15516 ;; 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
15517 ;; done in `gnus-get-unread-articles'.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15518 (and gnus-read-active-file
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15519 (not level)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15520 (gnus-read-active-file))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15521
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15522 (or gnus-active-hashtb
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15523 (setq gnus-active-hashtb (make-vector 4095 0)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15524
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15525 ;; Initialize the cache.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15526 (when gnus-use-cache
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15527 (gnus-cache-open))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15528
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15529 ;; Possibly eval the dribble file.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15530 (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
15531
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15532 ;; Slave Gnusii should then clear the dribble buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15533 (when (and init gnus-slave)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15534 (gnus-dribble-clear))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15535
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15536 (gnus-update-format-specifications)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15537
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15538 ;; See whether we need to read the description file.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15539 (if (and (string-match "%[-,0-9]*D" gnus-group-line-format)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15540 (not gnus-description-hashtb)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15541 (not dont-connect)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15542 gnus-read-active-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15543 (gnus-read-all-descriptions-files))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15544
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15545 ;; Find new newsgroups and treat them.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15546 (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
15547 (gnus-check-server gnus-select-method))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15548 (gnus-find-new-newsgroups))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15549
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15550 ;; We might read in new NoCeM messages here.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15551 (when (and gnus-use-nocem
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15552 (not level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15553 (not dont-connect))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15554 (gnus-nocem-scan-groups))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15555
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15556 ;; Find the number of unread articles in each non-dead group.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15557 (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
15558 (gnus-get-unread-articles level))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15559
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15560 (if (and init gnus-check-bogus-newsgroups
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15561 gnus-read-active-file (not level)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15562 (gnus-server-opened gnus-select-method))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15563 (gnus-check-bogus-newsgroups))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15564
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15565 (defun gnus-find-new-newsgroups (&optional arg)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15566 "Search for new newsgroups and add them.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15567 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
15568 The `-n' option line from .newsrc is respected.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15569 If ARG (the prefix), use the `ask-server' method to query
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15570 the server for new groups."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15571 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15572 (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
15573 (null gnus-read-active-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15574 (eq gnus-read-active-file 'some))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15575 'ask-server gnus-check-new-newsgroups)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15576 (unless (gnus-check-first-time-used)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15577 (if (or (consp check)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15578 (eq check 'ask-server))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15579 ;; Ask the server for new groups.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15580 (gnus-ask-server-for-new-groups)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15581 ;; Go through the active hashtb and look for new groups.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15582 (let ((groups 0)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15583 group new-newsgroups)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15584 (gnus-message 5 "Looking for new newsgroups...")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15585 (unless gnus-have-read-active-file
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15586 (gnus-read-active-file))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15587 (setq gnus-newsrc-last-checked-date (current-time-string))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15588 (unless gnus-killed-hashtb
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15589 (gnus-make-hashtable-from-killed))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15590 ;; Go though every newsgroup in `gnus-active-hashtb' and compare
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15591 ;; with `gnus-newsrc-hashtb' and `gnus-killed-hashtb'.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15592 (mapatoms
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15593 (lambda (sym)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15594 (if (or (null (setq group (symbol-name sym)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15595 (not (boundp sym))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15596 (null (symbol-value sym))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15597 (gnus-gethash group gnus-killed-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15598 (gnus-gethash group gnus-newsrc-hashtb))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15599 ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15600 (let ((do-sub (gnus-matches-options-n group)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15601 (cond
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15602 ((eq do-sub 'subscribe)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15603 (setq groups (1+ groups))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15604 (gnus-sethash group group gnus-killed-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15605 (funcall gnus-subscribe-options-newsgroup-method group))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15606 ((eq do-sub 'ignore)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15607 nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15608 (t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15609 (setq groups (1+ groups))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15610 (gnus-sethash group group gnus-killed-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15611 (if gnus-subscribe-hierarchical-interactive
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15612 (setq new-newsgroups (cons group new-newsgroups))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15613 (funcall gnus-subscribe-newsgroup-method group)))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15614 gnus-active-hashtb)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15615 (when new-newsgroups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15616 (gnus-subscribe-hierarchical-interactive new-newsgroups))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15617 ;; Suggested by Per Abrahamsen <amanda@iesd.auc.dk>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15618 (if (> groups 0)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15619 (gnus-message 6 "%d new newsgroup%s arrived."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15620 groups (if (> groups 1) "s have" " has"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15621 (gnus-message 6 "No new newsgroups.")))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15622
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15623 (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
15624 ;; Returns `subscribe' if the group is to be unconditionally
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15625 ;; 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
15626 ;; no match for the group.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15627
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15628 ;; First we check the two user variables.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15629 (cond
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15630 ((and gnus-options-subscribe
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15631 (string-match gnus-options-subscribe group))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15632 'subscribe)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15633 ((and gnus-auto-subscribed-groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15634 (string-match gnus-auto-subscribed-groups group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15635 'subscribe)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15636 ((and gnus-options-not-subscribe
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15637 (string-match gnus-options-not-subscribe group))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15638 'ignore)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15639 ;; 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
15640 ;; file. This list has elements on the form
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15641 ;; `(REGEXP . {ignore,subscribe})'. The first match found (the list
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15642 ;; is in the reverse order of the options line) is returned.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15643 (t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15644 (let ((regs gnus-newsrc-options-n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15645 (while (and regs
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15646 (not (string-match (caar regs) group)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15647 (setq regs (cdr regs)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15648 (and regs (cdar regs))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15649
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15650 (defun gnus-ask-server-for-new-groups ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15651 (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
15652 (methods (cons gnus-select-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15653 (nconc
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
15654 (when (gnus-archive-server-wanted-p)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15655 (list "archive"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15656 (append
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15657 (and (consp gnus-check-new-newsgroups)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15658 gnus-check-new-newsgroups)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15659 gnus-secondary-select-methods))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15660 (groups 0)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15661 (new-date (current-time-string))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15662 group new-newsgroups got-new method hashtb
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15663 gnus-override-subscribe-method)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15664 ;; Go through both primary and secondary select methods and
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15665 ;; request new newsgroups.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15666 (while (setq method (gnus-server-get-method nil (pop methods)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15667 (setq new-newsgroups nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15668 (setq gnus-override-subscribe-method method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15669 (when (and (gnus-check-server method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15670 (gnus-request-newgroups date method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15671 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15672 (setq got-new t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15673 (setq hashtb (gnus-make-hashtable 100))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15674 (set-buffer nntp-server-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15675 ;; Enter all the new groups into a hashtable.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15676 (gnus-active-to-gnus-format method hashtb 'ignore))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15677 ;; Now all new groups from `method' are in `hashtb'.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15678 (mapatoms
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15679 (lambda (group-sym)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15680 (if (or (null (setq group (symbol-name group-sym)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15681 (not (boundp group-sym))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15682 (null (symbol-value group-sym))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15683 (gnus-gethash group gnus-newsrc-hashtb)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15684 (member group gnus-zombie-list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15685 (member group gnus-killed-list))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15686 ;; The group is already known.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15687 ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15688 ;; Make this group active.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15689 (when (symbol-value group-sym)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15690 (gnus-set-active group (symbol-value group-sym)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15691 ;; Check whether we want it or not.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15692 (let ((do-sub (gnus-matches-options-n group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15693 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15694 ((eq do-sub 'subscribe)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15695 (incf groups)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15696 (gnus-sethash group group gnus-killed-hashtb)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15697 (funcall gnus-subscribe-options-newsgroup-method group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15698 ((eq do-sub 'ignore)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15699 nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15700 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15701 (incf groups)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15702 (gnus-sethash group group gnus-killed-hashtb)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15703 (if gnus-subscribe-hierarchical-interactive
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15704 (push group new-newsgroups)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15705 (funcall gnus-subscribe-newsgroup-method group)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15706 hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15707 (when new-newsgroups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15708 (gnus-subscribe-hierarchical-interactive new-newsgroups)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15709 ;; Suggested by Per Abrahamsen <amanda@iesd.auc.dk>.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15710 (when (> groups 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15711 (gnus-message 6 "%d new newsgroup%s arrived."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15712 groups (if (> groups 1) "s have" " has")))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15713 (and got-new (setq gnus-newsrc-last-checked-date new-date))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15714 got-new))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15715
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15716 (defun gnus-check-first-time-used ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15717 (if (or (> (length gnus-newsrc-alist) 1)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15718 (file-exists-p gnus-startup-file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15719 (file-exists-p (concat gnus-startup-file ".el"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15720 (file-exists-p (concat gnus-startup-file ".eld")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15721 nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15722 (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
15723 (unless (gnus-read-active-file-p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15724 (gnus-read-active-file))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15725 (setq gnus-newsrc-last-checked-date (current-time-string))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15726 (let ((groups gnus-default-subscribed-newsgroups)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15727 group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15728 (if (eq groups t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15729 nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15730 (setq groups (or groups gnus-backup-default-subscribed-newsgroups))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15731 (mapatoms
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15732 (lambda (sym)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15733 (if (null (setq group (symbol-name sym)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15734 ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15735 (let ((do-sub (gnus-matches-options-n group)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15736 (cond
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15737 ((eq do-sub 'subscribe)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15738 (gnus-sethash group group gnus-killed-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15739 (funcall gnus-subscribe-options-newsgroup-method group))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15740 ((eq do-sub 'ignore)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15741 nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15742 (t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15743 (setq gnus-killed-list (cons group gnus-killed-list)))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15744 gnus-active-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15745 (while groups
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15746 (if (gnus-active (car groups))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15747 (gnus-group-change-level
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15748 (car groups) gnus-level-default-subscribed gnus-level-killed))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15749 (setq groups (cdr groups)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15750 (gnus-group-make-help-group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15751 (and gnus-novice-user
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15752 (gnus-message 7 "`A k' to list killed groups"))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15753
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15754 (defun gnus-subscribe-group (group previous &optional method)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15755 (gnus-group-change-level
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15756 (if method
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15757 (list t group gnus-level-default-subscribed nil nil method)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15758 group)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15759 gnus-level-default-subscribed gnus-level-killed previous t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15760
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15761 ;; `gnus-group-change-level' is the fundamental function for changing
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15762 ;; subscription levels of newsgroups. This might mean just changing
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15763 ;; 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
15764 ;; again, which subscribes/unsubscribes a group, which is equally
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15765 ;; 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
15766 ;; 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
15767 ;; 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
15768 ;; 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
15769 ;; which is trivial.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15770 ;; 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
15771 ;; 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
15772 ;; 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
15773 ;; entries.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15774 ;; 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
15775 ;; 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
15776 ;; after.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15777 (defun gnus-group-change-level (entry level &optional oldlevel
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15778 previous fromkilled)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15779 (let (group info active num)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15780 ;; Glean what info we can from the arguments
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15781 (if (consp entry)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15782 (if fromkilled (setq group (nth 1 entry))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15783 (setq group (car (nth 2 entry))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15784 (setq group entry))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15785 (if (and (stringp entry)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15786 oldlevel
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15787 (< oldlevel gnus-level-zombie))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15788 (setq entry (gnus-gethash entry gnus-newsrc-hashtb)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15789 (if (and (not oldlevel)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15790 (consp entry))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15791 (setq oldlevel (gnus-info-level (nth 2 entry)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15792 (setq oldlevel (or oldlevel 9)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15793 (if (stringp previous)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15794 (setq previous (gnus-gethash previous gnus-newsrc-hashtb)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15795
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15796 (if (and (>= oldlevel gnus-level-zombie)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15797 (gnus-gethash group gnus-newsrc-hashtb))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15798 ;; We are trying to subscribe a group that is already
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15799 ;; subscribed.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15800 () ; Do nothing.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15801
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15802 (or (gnus-ephemeral-group-p group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15803 (gnus-dribble-enter
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15804 (format "(gnus-group-change-level %S %S %S %S %S)"
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15805 group level oldlevel (car (nth 2 previous)) fromkilled)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15806
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15807 ;; Then we remove the newgroup from any old structures, if needed.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15808 ;; 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
15809 ;; 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
15810 ;; it from the newsrc hash table and assoc.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15811 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15812 ((>= oldlevel gnus-level-zombie)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15813 (if (= oldlevel gnus-level-zombie)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15814 (setq gnus-zombie-list (delete group gnus-zombie-list))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15815 (setq gnus-killed-list (delete group gnus-killed-list))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15816 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15817 (if (and (>= level gnus-level-zombie)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15818 entry)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15819 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15820 (gnus-sethash (car (nth 2 entry)) nil gnus-newsrc-hashtb)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15821 (if (nth 3 entry)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15822 (setcdr (gnus-gethash (car (nth 3 entry))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15823 gnus-newsrc-hashtb)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15824 (cdr entry)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15825 (setcdr (cdr entry) (cdddr entry))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15826
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15827 ;; 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
15828 ;; 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
15829 ;; we enter it into the killed or zombie list.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15830 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15831 ((>= level gnus-level-zombie)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15832 ;; Remove from the hash table.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15833 (gnus-sethash group nil gnus-newsrc-hashtb)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15834 ;; We do not enter foreign groups into the list of dead
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15835 ;; groups.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15836 (unless (gnus-group-foreign-p group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15837 (if (= level gnus-level-zombie)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15838 (setq gnus-zombie-list (cons group gnus-zombie-list))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15839 (setq gnus-killed-list (cons group gnus-killed-list)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15840 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15841 ;; 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
15842 ;; 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
15843 ;; hashtb format and fix the pointers in the newsrc assoc.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15844 (if (< oldlevel gnus-level-zombie)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15845 ;; 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
15846 ;; just change the level and don't change any pointers or
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15847 ;; hash table entries.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15848 (setcar (cdaddr entry) level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15849 (if (listp entry)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15850 (setq info (cdr entry)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15851 num (car entry))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15852 (setq active (gnus-active group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15853 (setq num
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15854 (if active (- (1+ (cdr active)) (car active)) t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15855 ;; Check whether the group is foreign. If so, the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15856 ;; foreign select method has to be entered into the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15857 ;; info.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15858 (let ((method (or gnus-override-subscribe-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15859 (gnus-group-method group))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15860 (if (eq method gnus-select-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15861 (setq info (list group level nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15862 (setq info (list group level nil nil method)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15863 (unless previous
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15864 (setq previous
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15865 (let ((p gnus-newsrc-alist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15866 (while (cddr p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15867 (setq p (cdr p)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15868 p)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15869 (setq entry (cons info (cddr previous)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15870 (if (cdr previous)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15871 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15872 (setcdr (cdr previous) entry)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15873 (gnus-sethash group (cons num (cdr previous))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15874 gnus-newsrc-hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15875 (setcdr previous entry)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15876 (gnus-sethash group (cons num previous)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15877 gnus-newsrc-hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15878 (when (cdr entry)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15879 (setcdr (gnus-gethash (caadr entry) gnus-newsrc-hashtb) entry)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15880 (when gnus-group-change-level-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15881 (funcall gnus-group-change-level-function group level oldlevel)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15882
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15883 (defun gnus-kill-newsgroup (newsgroup)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15884 "Obsolete function. Kills a newsgroup."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15885 (gnus-group-change-level
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15886 (gnus-gethash newsgroup gnus-newsrc-hashtb) gnus-level-killed))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15887
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15888 (defun gnus-check-bogus-newsgroups (&optional confirm)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15889 "Remove bogus newsgroups.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15890 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
15891 newsgroup."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15892 (let ((newsrc (cdr gnus-newsrc-alist))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15893 bogus group entry info)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15894 (gnus-message 5 "Checking bogus newsgroups...")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15895 (unless (gnus-read-active-file-p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15896 (gnus-read-active-file))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15897 (when (gnus-read-active-file-p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15898 ;; Find all bogus newsgroup that are subscribed.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15899 (while newsrc
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15900 (setq info (pop newsrc)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15901 group (gnus-info-group info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15902 (unless (or (gnus-active group) ; Active
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15903 (gnus-info-method info) ; Foreign
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15904 (and confirm
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15905 (not (gnus-y-or-n-p
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15906 (format "Remove bogus newsgroup: %s " group)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15907 ;; Found a bogus newsgroup.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15908 (push group bogus)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15909 ;; Remove all bogus subscribed groups by first killing them, and
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15910 ;; then removing them from the list of killed groups.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15911 (while bogus
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15912 (when (setq entry (gnus-gethash (setq group (pop bogus))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15913 gnus-newsrc-hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15914 (gnus-group-change-level entry gnus-level-killed)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15915 (setq gnus-killed-list (delete group gnus-killed-list))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15916 ;; 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
15917 ;; zombie groups. They are are removed without confirmation.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15918 (let ((dead-lists '(gnus-killed-list gnus-zombie-list))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15919 killed)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15920 (while dead-lists
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15921 (setq killed (symbol-value (car dead-lists)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15922 (while killed
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15923 (unless (gnus-active (setq group (pop killed)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15924 ;; The group is bogus.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15925 ;; !!!Slow as hell.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15926 (set (car dead-lists)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15927 (delete group (symbol-value (car dead-lists))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15928 (setq dead-lists (cdr dead-lists))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15929 (gnus-message 5 "Checking bogus newsgroups...done"))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15930
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15931 (defun gnus-check-duplicate-killed-groups ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15932 "Remove duplicates from the list of killed groups."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15933 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15934 (let ((killed gnus-killed-list))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15935 (while killed
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15936 (gnus-message 9 "%d" (length killed))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15937 (setcdr killed (delete (car killed) (cdr killed)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15938 (setq killed (cdr killed)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15939
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15940 ;; 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
15941 (eval-when-compile
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15942 (provide 'gnus)
15669
84ad859492b2 ((provide 'gnus)): Make sure `gnus-directory' is defined
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15594
diff changeset
15943 (setq gnus-directory (or (getenv "SAVEDIR") "~/News/"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15944 (require 'gnus-cache))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15945
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15946 (defun gnus-get-unread-articles-in-group (info active &optional update)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15947 (when active
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15948 ;; Allow the backend to update the info in the group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15949 (when (and update
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15950 (gnus-request-update-info
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15951 info (gnus-find-method-for-group (gnus-info-group info))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15952 (gnus-activate-group (gnus-info-group info) nil t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15953 (let* ((range (gnus-info-read info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15954 (num 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15955 ;; 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
15956 (when (and gnus-use-cache info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15957 (inline (gnus-cache-possibly-alter-active
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15958 (gnus-info-group info) active)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15959 ;; Modify the list of read articles according to what articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15960 ;; are available; then tally the unread articles and add the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15961 ;; number to the group hash table entry.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15962 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15963 ((zerop (cdr active))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15964 (setq num 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15965 ((not range)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15966 (setq num (- (1+ (cdr active)) (car active))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15967 ((not (listp (cdr range)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15968 ;; Fix a single (num . num) range according to the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15969 ;; active hash table.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15970 ;; Fix by Carsten Bormann <cabo@Informatik.Uni-Bremen.DE>.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15971 (and (< (cdr range) (car active)) (setcdr range (1- (car active))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15972 (and (> (cdr range) (cdr active)) (setcdr range (cdr active)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15973 ;; Compute number of unread articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15974 (setq num (max 0 (- (cdr active) (- (1+ (cdr range)) (car range))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15975 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15976 ;; 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
15977 ;; the active hash table.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15978 ;; First peel off any elements that are below the lower
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15979 ;; active limit.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15980 (while (and (cdr range)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15981 (>= (car active)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15982 (or (and (atom (cadr range)) (cadr range))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15983 (caadr range))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15984 (if (numberp (car range))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15985 (setcar range
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15986 (cons (car range)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15987 (or (and (numberp (cadr range))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15988 (cadr range))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15989 (cdadr range))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15990 (setcdr (car range)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15991 (or (and (numberp (nth 1 range)) (nth 1 range))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15992 (cdadr range))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15993 (setcdr range (cddr range)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15994 ;; 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
15995 (if (and (not (atom (car range)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15996 (< (cdar range) (car active)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15997 (setcdr (car range) (1- (car active))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15998 ;; Then we want to peel off any elements that are higher
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15999 ;; than the upper active limit.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16000 (let ((srange range))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16001 ;; Go past all legal elements.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16002 (while (and (cdr srange)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16003 (<= (or (and (atom (cadr srange))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16004 (cadr srange))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16005 (caadr srange)) (cdr active)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16006 (setq srange (cdr srange)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16007 (if (cdr srange)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16008 ;; Nuke all remaining illegal elements.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16009 (setcdr srange nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16010
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16011 ;; Adjust the final element.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16012 (if (and (not (atom (car srange)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16013 (> (cdar srange) (cdr active)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16014 (setcdr (car srange) (cdr active))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16015 ;; Compute the number of unread articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16016 (while range
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16017 (setq num (+ num (- (1+ (or (and (atom (car range)) (car range))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16018 (cdar range)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16019 (or (and (atom (car range)) (car range))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16020 (caar range)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16021 (setq range (cdr range)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16022 (setq num (max 0 (- (cdr active) num)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16023 ;; Set the number of unread articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16024 (when info
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16025 (setcar (gnus-gethash (gnus-info-group info) gnus-newsrc-hashtb) num))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16026 num)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16027
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16028 ;; Go though `gnus-newsrc-alist' and compare with `gnus-active-hashtb'
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16029 ;; 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
16030 (defun gnus-get-unread-articles (&optional level)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16031 (let* ((newsrc (cdr gnus-newsrc-alist))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16032 (level (or level gnus-activate-level (1+ gnus-level-subscribed)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16033 (foreign-level
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16034 (min
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16035 (cond ((and gnus-activate-foreign-newsgroups
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16036 (not (numberp gnus-activate-foreign-newsgroups)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16037 (1+ gnus-level-subscribed))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16038 ((numberp gnus-activate-foreign-newsgroups)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16039 gnus-activate-foreign-newsgroups)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16040 (t 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16041 level))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16042 info group active method)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16043 (gnus-message 5 "Checking new news...")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16044
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16045 (while newsrc
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16046 (setq active (gnus-active (setq group (gnus-info-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16047 (setq info (pop newsrc))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16048
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16049 ;; 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
16050 ;; 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
16051 ;; 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
16052 ;; 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
16053 ;; unread articles, but it has no idea how many.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16054 (if (and (setq method (gnus-info-method info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16055 (not (gnus-server-equal
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16056 gnus-select-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16057 (setq method (gnus-server-get-method nil method))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16058 (not (gnus-secondary-method-p method)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16059 ;; These groups are foreign. Check the level.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16060 (when (<= (gnus-info-level info) foreign-level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16061 (setq active (gnus-activate-group group 'scan))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16062 (unless (inline (gnus-virtual-group-p group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16063 (inline (gnus-close-group group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16064 (when (fboundp (intern (concat (symbol-name (car method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16065 "-request-update-info")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16066 (inline (gnus-request-update-info info method))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16067 ;; These groups are native or secondary.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16068 (when (and (<= (gnus-info-level info) level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16069 (not gnus-read-active-file))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16070 (setq active (gnus-activate-group group 'scan))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16071 (inline (gnus-close-group group))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16072
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16073 ;; Get the number of unread articles in the group.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16074 (if active
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16075 (inline (gnus-get-unread-articles-in-group info active))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16076 ;; 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
16077 ;; unread articles and stuff.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16078 (gnus-set-active group nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16079 (setcar (gnus-gethash group gnus-newsrc-hashtb) t)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16080
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16081 (gnus-message 5 "Checking new news...done")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16082
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16083 ;; 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
16084 ;; alist elements are used as keys.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16085 (defun gnus-make-hashtable-from-newsrc-alist ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16086 (let ((alist gnus-newsrc-alist)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16087 (ohashtb gnus-newsrc-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16088 prev)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16089 (setq gnus-newsrc-hashtb (gnus-make-hashtable (length alist)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16090 (setq alist
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16091 (setq prev (setq gnus-newsrc-alist
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16092 (if (equal (caar gnus-newsrc-alist)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16093 "dummy.group")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16094 gnus-newsrc-alist
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16095 (cons (list "dummy.group" 0 nil) alist)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16096 (while alist
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16097 (gnus-sethash
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16098 (caar alist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16099 (cons (and ohashtb (car (gnus-gethash (caar alist) ohashtb)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16100 prev)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16101 gnus-newsrc-hashtb)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16102 (setq prev alist
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16103 alist (cdr alist)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16104
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16105 (defun gnus-make-hashtable-from-killed ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16106 "Create a hash table from the killed and zombie lists."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16107 (let ((lists '(gnus-killed-list gnus-zombie-list))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16108 list)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16109 (setq gnus-killed-hashtb
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16110 (gnus-make-hashtable
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16111 (+ (length gnus-killed-list) (length gnus-zombie-list))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16112 (while (setq list (pop lists))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16113 (setq list (symbol-value list))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16114 (while list
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16115 (gnus-sethash (car list) (pop list) gnus-killed-hashtb)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16116
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16117 (defun gnus-activate-group (group &optional scan dont-check method)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16118 ;; Check whether a group has been activated or not.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16119 ;; If SCAN, request a scan of that group as well.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16120 (let ((method (or method (gnus-find-method-for-group group)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16121 active)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16122 (and (gnus-check-server method)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16123 ;; 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
16124 ;; 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
16125 ;; and stuff.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16126 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16127 (and scan
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16128 (gnus-check-backend-function 'request-scan (car method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16129 (gnus-request-scan group method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16130 t)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16131 (condition-case ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16132 (gnus-request-group group dont-check method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16133 ; (error nil)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16134 (quit nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16135 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16136 (set-buffer nntp-server-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16137 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16138 ;; Parse the result we got from `gnus-request-group'.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16139 (and (looking-at "[0-9]+ [0-9]+ \\([0-9]+\\) [0-9]+")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16140 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16141 (goto-char (match-beginning 1))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16142 (gnus-set-active
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16143 group (setq active (cons (read (current-buffer))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16144 (read (current-buffer)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16145 ;; Return the new active info.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16146 active))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16147
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16148 (defun gnus-update-read-articles (group unread)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16149 "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
16150 UNREAD and TICKED lists.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16151 Note: UNSELECTED has to be sorted over `<'.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16152 Returns whether the updating was successful."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16153 (let* ((active (or gnus-newsgroup-active (gnus-active group)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16154 (entry (gnus-gethash group gnus-newsrc-hashtb))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16155 (info (nth 2 entry))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16156 (prev 1)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16157 (unread (sort (copy-sequence unread) '<))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16158 read)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16159 (if (or (not info) (not active))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16160 ;; 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
16161 ;; killed. Gnus stores no information on killed groups, so
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16162 ;; there's nothing to be done.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16163 ;; One could store the information somewhere temporarily,
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16164 ;; perhaps... Hmmm...
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16165 ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16166 ;; Remove any negative articles numbers.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16167 (while (and unread (< (car unread) 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16168 (setq unread (cdr unread)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16169 ;; Remove any expired article numbers
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16170 (while (and unread (< (car unread) (car active)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16171 (setq unread (cdr unread)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16172 ;; 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
16173 ;; unread articles.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16174 (while unread
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16175 (if (/= (car unread) prev)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16176 (setq read (cons (if (= prev (1- (car unread))) prev
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16177 (cons prev (1- (car unread)))) read)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16178 (setq prev (1+ (car unread)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16179 (setq unread (cdr unread)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16180 (when (<= prev (cdr active))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16181 (setq read (cons (cons prev (cdr active)) read)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16182 ;; Enter this list into the group info.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16183 (gnus-info-set-read
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16184 info (if (> (length read) 1) (nreverse read) read))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16185 ;; Set the number of unread articles in gnus-newsrc-hashtb.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16186 (gnus-get-unread-articles-in-group info (gnus-active group))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16187 t)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16188
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16189 (defun gnus-make-articles-unread (group articles)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16190 "Mark ARTICLES in GROUP as unread."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16191 (let* ((info (nth 2 (or (gnus-gethash group gnus-newsrc-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16192 (gnus-gethash (gnus-group-real-name group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16193 gnus-newsrc-hashtb))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16194 (ranges (gnus-info-read info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16195 news article)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16196 (while articles
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16197 (when (gnus-member-of-range
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16198 (setq article (pop articles)) ranges)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16199 (setq news (cons article news))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16200 (when news
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16201 (gnus-info-set-read
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16202 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
16203 (gnus-group-update-group group t))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16204
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16205 ;; Enter all dead groups into the hashtb.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16206 (defun gnus-update-active-hashtb-from-killed ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16207 (let ((hashtb (setq gnus-active-hashtb (make-vector 4095 0)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16208 (lists (list gnus-killed-list gnus-zombie-list))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16209 killed)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16210 (while lists
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16211 (setq killed (car lists))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16212 (while killed
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16213 (gnus-sethash (car killed) nil hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16214 (setq killed (cdr killed)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16215 (setq lists (cdr lists)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16216
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16217 (defun gnus-get-killed-groups ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16218 "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
16219 ;; First make sure active file has been read.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16220 (unless (gnus-read-active-file-p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16221 (let ((gnus-read-active-file t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16222 (gnus-read-active-file)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16223 (or gnus-killed-hashtb (gnus-make-hashtable-from-killed))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16224 ;; 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
16225 (mapatoms
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16226 (lambda (sym)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16227 (let ((groups 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16228 (group (symbol-name sym)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16229 (if (or (null group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16230 (gnus-gethash group gnus-killed-hashtb)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16231 (gnus-gethash group gnus-newsrc-hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16232 ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16233 (let ((do-sub (gnus-matches-options-n group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16234 (if (or (eq do-sub 'subscribe) (eq do-sub 'ignore))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16235 ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16236 (setq groups (1+ groups))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16237 (setq gnus-killed-list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16238 (cons group gnus-killed-list))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16239 (gnus-sethash group group gnus-killed-hashtb))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16240 gnus-active-hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16241
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16242 ;; Get the active file(s) from the backend(s).
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16243 (defun gnus-read-active-file ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16244 (gnus-group-set-mode-line)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16245 (let ((methods
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16246 (append
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16247 (if (gnus-check-server gnus-select-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16248 ;; The native server is available.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16249 (cons gnus-select-method gnus-secondary-select-methods)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16250 ;; The native server is down, so we just do the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16251 ;; secondary ones.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16252 gnus-secondary-select-methods)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16253 ;; Also read from the archive server.
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
16254 (when (gnus-archive-server-wanted-p)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16255 (list "archive"))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16256 list-type)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16257 (setq gnus-have-read-active-file nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16258 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16259 (set-buffer nntp-server-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16260 (while methods
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16261 (let* ((method (if (stringp (car methods))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16262 (gnus-server-get-method nil (car methods))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16263 (car methods)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16264 (where (nth 1 method))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16265 (mesg (format "Reading active file%s via %s..."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16266 (if (and where (not (zerop (length where))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16267 (concat " from " where) "")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16268 (car method))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16269 (gnus-message 5 mesg)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16270 (when (gnus-check-server method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16271 ;; Request that the backend scan its incoming messages.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16272 (and (gnus-check-backend-function 'request-scan (car method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16273 (gnus-request-scan nil method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16274 (cond
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16275 ((and (eq gnus-read-active-file 'some)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16276 (gnus-check-backend-function 'retrieve-groups (car method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16277 (let ((newsrc (cdr gnus-newsrc-alist))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16278 (gmethod (gnus-server-get-method nil method))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16279 groups info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16280 (while (setq info (pop newsrc))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16281 (when (gnus-server-equal
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16282 (gnus-find-method-for-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16283 (gnus-info-group info) info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16284 gmethod)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16285 (push (gnus-group-real-name (gnus-info-group info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16286 groups)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16287 (when groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16288 (gnus-check-server method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16289 (setq list-type (gnus-retrieve-groups groups method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16290 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16291 ((not list-type)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16292 (gnus-error
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16293 1.2 "Cannot read partial active file from %s server."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16294 (car method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16295 ((eq list-type 'active)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16296 (gnus-active-to-gnus-format method gnus-active-hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16297 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16298 (gnus-groups-to-gnus-format method gnus-active-hashtb))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16299 (t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16300 (if (not (gnus-request-list method))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16301 (unless (equal method gnus-message-archive-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16302 (gnus-error 1 "Cannot read active file from %s server."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16303 (car method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16304 (gnus-message 5 mesg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16305 (gnus-active-to-gnus-format method gnus-active-hashtb)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16306 ;; We mark this active file as read.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16307 (push method gnus-have-read-active-file)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16308 (gnus-message 5 "%sdone" mesg))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16309 (setq methods (cdr methods))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16310
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16311 ;; 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
16312 (defun gnus-active-to-gnus-format (&optional method hashtb ignore-errors)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16313 (unless method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16314 (setq method gnus-select-method))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16315 (let ((cur (current-buffer))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16316 (hashtb (or hashtb
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16317 (if (and gnus-active-hashtb
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16318 (not (equal method gnus-select-method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16319 gnus-active-hashtb
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16320 (setq gnus-active-hashtb
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16321 (if (equal method gnus-select-method)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16322 (gnus-make-hashtable
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16323 (count-lines (point-min) (point-max)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16324 (gnus-make-hashtable 4096)))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16325 ;; Delete unnecessary lines.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16326 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16327 (while (search-forward "\nto." nil t)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16328 (delete-region (1+ (match-beginning 0))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16329 (progn (forward-line 1) (point))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16330 (or (string= gnus-ignored-newsgroups "")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16331 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16332 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16333 (delete-matching-lines gnus-ignored-newsgroups)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16334 ;; 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
16335 ;; contain special characters.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16336 ;; Fix by Luc Van Eycken <Luc.VanEycken@esat.kuleuven.ac.be>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16337 (goto-char (point-max))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16338 (while (re-search-backward "[][';?()#]" nil t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16339 (insert ?\\))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16340 ;; 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
16341 ;; group prefix in front of the group names.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16342 (and method (not (gnus-server-equal
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16343 (gnus-server-get-method nil method)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16344 (gnus-server-get-method nil gnus-select-method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16345 (let ((prefix (gnus-group-prefixed-name "" method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16346 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16347 (while (and (not (eobp))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16348 (progn (insert prefix)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16349 (zerop (forward-line 1)))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16350 ;; Store the active file in a hash table.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16351 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16352 (if (string-match "%[oO]" gnus-group-line-format)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16353 ;; Suggested by Brian Edmonds <edmonds@cs.ubc.ca>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16354 ;; If we want information on moderated groups, we use this
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16355 ;; loop...
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16356 (let* ((mod-hashtb (make-vector 7 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16357 (m (intern "m" mod-hashtb))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16358 group max min)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16359 (while (not (eobp))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16360 (condition-case nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16361 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16362 (narrow-to-region (point) (gnus-point-at-eol))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16363 (setq group (let ((obarray hashtb)) (read cur)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16364 (if (and (numberp (setq max (read cur)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16365 (numberp (setq min (read cur)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16366 (progn
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16367 (skip-chars-forward " \t")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16368 (not
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16369 (or (= (following-char) ?=)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16370 (= (following-char) ?x)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16371 (= (following-char) ?j)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16372 (set group (cons min max))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16373 (set group nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16374 ;; Enter moderated groups into a list.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16375 (if (eq (let ((obarray mod-hashtb)) (read cur)) m)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16376 (setq gnus-moderated-list
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16377 (cons (symbol-name group) gnus-moderated-list))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16378 (error
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16379 (and group
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16380 (symbolp group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16381 (set group nil))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16382 (widen)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16383 (forward-line 1)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16384 ;; 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
16385 ;; which is faster.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16386 (let (group max min)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16387 (while (not (eobp))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16388 (condition-case ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16389 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16390 (narrow-to-region (point) (gnus-point-at-eol))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16391 ;; group gets set to a symbol interned in the hash table
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16392 ;; (what a hack!!) - jwz
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16393 (setq group (let ((obarray hashtb)) (read cur)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16394 (if (and (numberp (setq max (read cur)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16395 (numberp (setq min (read cur)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16396 (progn
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16397 (skip-chars-forward " \t")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16398 (not
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16399 (or (= (following-char) ?=)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16400 (= (following-char) ?x)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16401 (= (following-char) ?j)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16402 (set group (cons min max))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16403 (set group nil)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16404 (error
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16405 (progn
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16406 (and group
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16407 (symbolp group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16408 (set group nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16409 (or ignore-errors
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16410 (gnus-message 3 "Warning - illegal active: %s"
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16411 (buffer-substring
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16412 (gnus-point-at-bol) (gnus-point-at-eol)))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16413 (widen)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16414 (forward-line 1))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16415
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16416 (defun gnus-groups-to-gnus-format (method &optional hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16417 ;; Parse a "groups" active file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16418 (let ((cur (current-buffer))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16419 (hashtb (or hashtb
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16420 (if (and method gnus-active-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16421 gnus-active-hashtb
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16422 (setq gnus-active-hashtb
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16423 (gnus-make-hashtable
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16424 (count-lines (point-min) (point-max)))))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16425 (prefix (and method
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16426 (not (gnus-server-equal
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16427 (gnus-server-get-method nil method)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16428 (gnus-server-get-method nil gnus-select-method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16429 (gnus-group-prefixed-name "" method))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16430
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16431 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16432 ;; We split this into to separate loops, one with the prefix
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16433 ;; and one without to speed the reading up somewhat.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16434 (if prefix
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16435 (let (min max opoint group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16436 (while (not (eobp))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16437 (condition-case ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16438 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16439 (read cur) (read cur)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16440 (setq min (read cur)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16441 max (read cur)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16442 opoint (point))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16443 (skip-chars-forward " \t")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16444 (insert prefix)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16445 (goto-char opoint)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16446 (set (let ((obarray hashtb)) (read cur))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16447 (cons min max)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16448 (error (and group (symbolp group) (set group nil))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16449 (forward-line 1)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16450 (let (min max group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16451 (while (not (eobp))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16452 (condition-case ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16453 (if (= (following-char) ?2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16454 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16455 (read cur) (read cur)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16456 (setq min (read cur)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16457 max (read cur))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16458 (set (setq group (let ((obarray hashtb)) (read cur)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16459 (cons min max))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16460 (error (and group (symbolp group) (set group nil))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16461 (forward-line 1))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16462
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16463 (defun gnus-read-newsrc-file (&optional force)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16464 "Read startup file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16465 If FORCE is non-nil, the .newsrc file is read."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16466 ;; Reset variables that might be defined in the .newsrc.eld file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16467 (let ((variables gnus-variable-list))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16468 (while variables
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16469 (set (car variables) nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16470 (setq variables (cdr variables))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16471 (let* ((newsrc-file gnus-current-startup-file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16472 (quick-file (concat newsrc-file ".el")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16473 (save-excursion
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16474 ;; We always load the .newsrc.eld file. If always contains
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16475 ;; much information that can not be gotten from the .newsrc
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16476 ;; file (ticked articles, killed groups, foreign methods, etc.)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16477 (gnus-read-newsrc-el-file quick-file)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16478
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16479 (if (and (file-exists-p gnus-current-startup-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16480 (or force
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16481 (and (file-newer-than-file-p newsrc-file quick-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16482 (file-newer-than-file-p newsrc-file
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16483 (concat quick-file "d")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16484 (not gnus-newsrc-alist)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16485 ;; 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
16486 ;; .newsrc.eld file exists, it has already been read, and
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16487 ;; the `gnus-newsrc-hashtb' has been created. While reading
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16488 ;; the .newsrc file, Gnus will only use the information it
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16489 ;; can find there for changing the data already read -
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16490 ;; ie. reading the .newsrc file will not trash the data
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16491 ;; already read (except for read articles).
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16492 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16493 (gnus-message 5 "Reading %s..." newsrc-file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16494 (set-buffer (find-file-noselect newsrc-file))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16495 (buffer-disable-undo (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16496 (gnus-newsrc-to-gnus-format)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16497 (kill-buffer (current-buffer))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16498 (gnus-message 5 "Reading %s...done" newsrc-file)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16499
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16500 ;; Read any slave files.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16501 (unless gnus-slave
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16502 (gnus-master-read-slave-newsrc))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16503
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16504 ;; Convert old to new.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16505 (gnus-convert-old-newsrc))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16506
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16507 (defun gnus-continuum-version (version)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16508 "Return VERSION as a floating point number."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16509 (when (or (string-match "^\\([^ ]+\\)? ?Gnus v?\\([0-9.]+\\)$" version)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16510 (string-match "^\\(.?\\)gnus-\\([0-9.]+\\)$" version))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16511 (let* ((alpha (and (match-beginning 1) (match-string 1 version)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16512 (number (match-string 2 version))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16513 major minor least)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16514 (string-match "\\([0-9]\\)\\.\\([0-9]+\\)\\.?\\([0-9]+\\)?" number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16515 (setq major (string-to-number (match-string 1 number)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16516 (setq minor (string-to-number (match-string 2 number)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16517 (setq least (if (match-beginning 3)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16518 (string-to-number (match-string 3 number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16519 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16520 (string-to-number
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16521 (if (zerop major)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16522 (format "%s00%02d%02d"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16523 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16524 ((member alpha '("(ding)" "d")) "4.99")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16525 ((member alpha '("September" "s")) "5.01")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16526 ((member alpha '("Red" "r")) "5.03"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16527 minor least)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16528 (format "%d.%02d%02d" major minor least))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16529
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16530 (defun gnus-convert-old-newsrc ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16531 "Convert old newsrc into the new format, if needed."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16532 (let ((fcv (and gnus-newsrc-file-version
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16533 (gnus-continuum-version gnus-newsrc-file-version))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16534 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16535 ;; No .newsrc.eld file was loaded.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16536 ((null fcv) nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16537 ;; Gnus 5 .newsrc.eld was loaded.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16538 ((< fcv (gnus-continuum-version "September Gnus v0.1"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16539 (gnus-convert-old-ticks)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16540
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16541 (defun gnus-convert-old-ticks ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16542 (let ((newsrc (cdr gnus-newsrc-alist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16543 marks info dormant ticked)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16544 (while (setq info (pop newsrc))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16545 (when (setq marks (gnus-info-marks info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16546 (setq dormant (cdr (assq 'dormant marks))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16547 ticked (cdr (assq 'tick marks)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16548 (when (or dormant ticked)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16549 (gnus-info-set-read
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16550 info
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16551 (gnus-add-to-range
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16552 (gnus-info-read info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16553 (nconc (gnus-uncompress-range dormant)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16554 (gnus-uncompress-range ticked)))))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16555
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16556 (defun gnus-read-newsrc-el-file (file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16557 (let ((ding-file (concat file "d")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16558 ;; We always, always read the .eld file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16559 (gnus-message 5 "Reading %s..." ding-file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16560 (let (gnus-newsrc-assoc)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16561 (condition-case nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16562 (load ding-file t t t)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16563 (error
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16564 (gnus-error 1 "Error in %s" ding-file)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16565 (when gnus-newsrc-assoc
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16566 (setq gnus-newsrc-alist gnus-newsrc-assoc)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16567 (gnus-make-hashtable-from-newsrc-alist)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16568 (when (file-newer-than-file-p file ding-file)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16569 ;; Old format quick file
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16570 (gnus-message 5 "Reading %s..." file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16571 ;; 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
16572 ;; as well.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16573 (gnus-read-old-newsrc-el-file file))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16574
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16575 ;; Parse the old-style quick startup file
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16576 (defun gnus-read-old-newsrc-el-file (file)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16577 (let (newsrc killed marked group m info)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16578 (prog1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16579 (let ((gnus-killed-assoc nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16580 gnus-marked-assoc gnus-newsrc-alist gnus-newsrc-assoc)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16581 (prog1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16582 (condition-case nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16583 (load file t t t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16584 (error nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16585 (setq newsrc gnus-newsrc-assoc
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16586 killed gnus-killed-assoc
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16587 marked gnus-marked-assoc)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16588 (setq gnus-newsrc-alist nil)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16589 (while (setq group (pop newsrc))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16590 (if (setq info (gnus-get-info (car group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16591 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16592 (gnus-info-set-read info (cddr group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16593 (gnus-info-set-level
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16594 info (if (nth 1 group) gnus-level-default-subscribed
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16595 gnus-level-default-unsubscribed))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16596 (setq gnus-newsrc-alist (cons info gnus-newsrc-alist)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16597 (push (setq info
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16598 (list (car group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16599 (if (nth 1 group) gnus-level-default-subscribed
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16600 gnus-level-default-unsubscribed)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16601 (cddr group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16602 gnus-newsrc-alist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16603 ;; Copy marks into info.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16604 (when (setq m (assoc (car group) marked))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16605 (unless (nthcdr 3 info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16606 (nconc info (list nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16607 (gnus-info-set-marks
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16608 info (list (cons 'tick (gnus-compress-sequence
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16609 (sort (cdr m) '<) t))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16610 (setq newsrc killed)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16611 (while newsrc
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16612 (setcar newsrc (caar newsrc))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16613 (setq newsrc (cdr newsrc)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16614 (setq gnus-killed-list killed))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16615 ;; The .el file version of this variable does not begin with
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16616 ;; "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
16617 ;; isn't there.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16618 (and
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16619 gnus-newsrc-options
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16620 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16621 (and (not (string-match "^ *options" gnus-newsrc-options))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16622 (setq gnus-newsrc-options (concat "options " gnus-newsrc-options)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16623 (and (not (string-match "\n$" gnus-newsrc-options))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16624 (setq gnus-newsrc-options (concat gnus-newsrc-options "\n")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16625 ;; Finally, if we read some options lines, we parse them.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16626 (or (string= gnus-newsrc-options "")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16627 (gnus-newsrc-parse-options gnus-newsrc-options))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16628
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16629 (setq gnus-newsrc-alist (nreverse gnus-newsrc-alist))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16630 (gnus-make-hashtable-from-newsrc-alist)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16631
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16632 (defun gnus-make-newsrc-file (file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16633 "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
16634 (let* ((file (expand-file-name file nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16635 (real-file (concat file "-" (nth 1 gnus-select-method))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16636 (if (or (file-exists-p real-file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16637 (file-exists-p (concat real-file ".el"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16638 (file-exists-p (concat real-file ".eld")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16639 real-file file)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16640
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16641 (defun gnus-newsrc-to-gnus-format ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16642 (setq gnus-newsrc-options "")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16643 (setq gnus-newsrc-options-n nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16644
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16645 (or gnus-active-hashtb
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16646 (setq gnus-active-hashtb (make-vector 4095 0)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16647 (let ((buf (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16648 (already-read (> (length gnus-newsrc-alist) 1))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16649 group subscribed options-symbol newsrc Options-symbol
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16650 symbol reads num1)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16651 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16652 ;; 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
16653 ;; can `eq' against it later.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16654 (set (setq options-symbol (intern "options" gnus-active-hashtb)) nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16655 (set (setq Options-symbol (intern "Options" gnus-active-hashtb)) nil)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16656
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16657 (while (not (eobp))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16658 ;; 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
16659 ;; then reading into `gnus-active-hashtb'. Most groups will
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16660 ;; already exist in that hashtb, so this will save some string
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16661 ;; space.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16662 (narrow-to-region
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16663 (point)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16664 (progn (skip-chars-forward "^ \t!:\n") (point)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16665 (goto-char (point-min))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16666 (setq symbol
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16667 (and (/= (point-min) (point-max))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16668 (let ((obarray gnus-active-hashtb)) (read buf))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16669 (widen)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16670 ;; 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
16671 ;; 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
16672 (cond
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16673 ((or (eq symbol options-symbol)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16674 (eq symbol Options-symbol))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16675 (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
16676 ;; This concating is quite inefficient, but since our
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16677 ;; thorough studies show that approx 99.37% of all
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16678 ;; .newsrc files only contain a single options line, we
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16679 ;; don't give a damn, frankly, my dear.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16680 (concat gnus-newsrc-options
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16681 (buffer-substring
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16682 (gnus-point-at-bol)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16683 ;; Options may continue on the next line.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16684 (or (and (re-search-forward "^[^ \t]" nil 'move)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16685 (progn (beginning-of-line) (point)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16686 (point)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16687 (forward-line -1))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16688 (symbol
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16689 ;; Group names can be just numbers.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16690 (when (numberp symbol)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16691 (setq symbol (intern (int-to-string symbol) gnus-active-hashtb)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16692 (or (boundp symbol) (set symbol nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16693 ;; It was a group name.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16694 (setq subscribed (= (following-char) ?:)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16695 group (symbol-name symbol)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16696 reads nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16697 (if (eolp)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16698 ;; 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
16699 ;; 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
16700 ;; below do the error handling.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16701 (beginning-of-line)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16702 ;; We skip to the beginning of the ranges.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16703 (skip-chars-forward "!: \t"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16704 ;; 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
16705 ;; We read them range by range.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16706 (while
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16707 (cond
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16708 ((looking-at "[0-9]+")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16709 ;; We narrow and read a number instead of buffer-substring/
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16710 ;; string-to-int because it's faster. narrow/widen is
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16711 ;; faster than save-restriction/narrow, and save-restriction
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16712 ;; produces a garbage object.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16713 (setq num1 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16714 (narrow-to-region (match-beginning 0) (match-end 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16715 (read buf)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16716 (widen)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16717 ;; 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
16718 (if (= (following-char) ?-)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16719 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16720 ;; We read the upper bound of the range.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16721 (forward-char 1)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16722 (if (not (looking-at "[0-9]+"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16723 ;; This is a buggy line, by we pretend that
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16724 ;; it's kinda OK. Perhaps the user should be
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16725 ;; dinged?
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16726 (setq reads (cons num1 reads))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16727 (setq reads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16728 (cons
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16729 (cons num1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16730 (progn
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16731 (narrow-to-region (match-beginning 0)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16732 (match-end 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16733 (read buf)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16734 reads))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16735 (widen)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16736 ;; 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
16737 ;; list of ranges.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16738 (setq reads (cons num1 reads)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16739 ;; 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
16740 ;; of the line and return nil.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16741 (/= (following-char) ?\n))
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 ;; End of line, so we end.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16744 nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16745 (t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16746 ;; 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
16747 ;; line...
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16748 (or (eobp)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16749 ;; If it was eob instead of ?\n, we allow it.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16750 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16751 ;; The line was buggy.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16752 (setq group nil)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16753 (gnus-error 3.1 "Mangled line: %s"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16754 (buffer-substring (gnus-point-at-bol)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16755 (gnus-point-at-eol)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16756 nil))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16757 ;; Skip past ", ". Spaces are illegal in these ranges, but
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16758 ;; 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
16759 ;; space after the comma.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16760 (skip-chars-forward ", "))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16761
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16762 ;; We have already read .newsrc.eld, so we gently update the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16763 ;; 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
16764 ;; read.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16765 (when group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16766 (let ((info (gnus-get-info group))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16767 level)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16768 (if info
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16769 ;; There is an entry for this file in the alist.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16770 (progn
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16771 (gnus-info-set-read info (nreverse reads))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16772 ;; We update the level very gently. In fact, we
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16773 ;; only change it if there's been a status change
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16774 ;; from subscribed to unsubscribed, or vice versa.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16775 (setq level (gnus-info-level info))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16776 (cond ((and (<= level gnus-level-subscribed)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16777 (not subscribed))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16778 (setq level (if reads
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16779 gnus-level-default-unsubscribed
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16780 (1+ gnus-level-default-unsubscribed))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16781 ((and (> level gnus-level-subscribed) subscribed)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16782 (setq level gnus-level-default-subscribed)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16783 (gnus-info-set-level info level))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16784 ;; This is a new group.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16785 (setq info (list group
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16786 (if subscribed
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16787 gnus-level-default-subscribed
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16788 (if reads
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16789 (1+ gnus-level-subscribed)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16790 gnus-level-default-unsubscribed))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16791 (nreverse reads))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16792 (setq newsrc (cons info newsrc))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16793 (forward-line 1))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16794
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16795 (setq newsrc (nreverse newsrc))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16796
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16797 (if (not already-read)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16798 ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16799 ;; We now have two newsrc lists - `newsrc', which is what we
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16800 ;; have read from .newsrc, and `gnus-newsrc-alist', which is
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16801 ;; 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
16802 ;; lists. We do this by "attaching" any (foreign) groups in the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16803 ;; gnus-newsrc-alist to the (native) group that precedes them.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16804 (let ((rc (cdr gnus-newsrc-alist))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16805 (prev gnus-newsrc-alist)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16806 entry mentry)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16807 (while rc
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16808 (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
16809 (assoc (caar rc) newsrc) ; It's already in the alist.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16810 (if (setq entry (assoc (caar prev) newsrc))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16811 (setcdr (setq mentry (memq entry newsrc))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16812 (cons (car rc) (cdr mentry)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16813 (setq newsrc (cons (car rc) newsrc))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16814 (setq prev rc
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16815 rc (cdr rc)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16816
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16817 (setq gnus-newsrc-alist newsrc)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16818 ;; We make the newsrc hashtb.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16819 (gnus-make-hashtable-from-newsrc-alist)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16820
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16821 ;; Finally, if we read some options lines, we parse them.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16822 (or (string= gnus-newsrc-options "")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16823 (gnus-newsrc-parse-options gnus-newsrc-options))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16824
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16825 ;; 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
16826 ;; The return value will be a list on the form
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16827 ;; ((regexp1 . ignore)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16828 ;; (regexp2 . subscribe)...)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16829 ;; When handling new newsgroups, groups that match a `ignore' regexp
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16830 ;; 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
16831 ;; subscribed. A line like
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16832 ;; options -n !all rec.all
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16833 ;; will lead to a list that looks like
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16834 ;; (("^rec\\..+" . subscribe)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16835 ;; ("^.+" . ignore))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16836 ;; 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
16837 ;; 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
16838 ;; different from "options -n rec.all !all".
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16839 (defun gnus-newsrc-parse-options (options)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16840 (let (out eol)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16841 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16842 (gnus-set-work-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16843 (insert (regexp-quote options))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16844 ;; First we treat all continuation lines.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16845 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16846 (while (re-search-forward "\n[ \t]+" nil t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16847 (replace-match " " t t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16848 ;; Then we transform all "all"s into ".+"s.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16849 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16850 (while (re-search-forward "\\ball\\b" nil t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16851 (replace-match ".+" t t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16852 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16853 ;; We remove all other options than the "-n" ones.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16854 (while (re-search-forward "[ \t]-[^n][^-]*" nil t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16855 (replace-match " ")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16856 (forward-char -1))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16857 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16858
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16859 ;; We are only interested in "options -n" lines - we
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16860 ;; ignore the other option lines.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16861 (while (re-search-forward "[ \t]-n" nil t)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16862 (setq eol
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16863 (or (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16864 (and (re-search-forward "[ \t]-n" (gnus-point-at-eol) t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16865 (- (point) 2)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16866 (gnus-point-at-eol)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16867 ;; Search for all "words"...
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16868 (while (re-search-forward "[^ \t,\n]+" eol t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16869 (if (= (char-after (match-beginning 0)) ?!)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16870 ;; 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
16871 ;; spec. We put this spec (minus the bang) and the
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16872 ;; symbol `ignore' into the list.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16873 (setq out (cons (cons (concat
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16874 "^" (buffer-substring
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16875 (1+ (match-beginning 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16876 (match-end 0)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16877 'ignore) out))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16878 ;; There was no bang, so this is a "yes" spec.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16879 (setq out (cons (cons (concat "^" (match-string 0))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16880 'subscribe) out)))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16881
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16882 (setq gnus-newsrc-options-n out))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16883
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16884 (defun gnus-save-newsrc-file (&optional force)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16885 "Save .newsrc file."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16886 ;; Note: We cannot save .newsrc file if all newsgroups are removed
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16887 ;; from the variable gnus-newsrc-alist.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16888 (when (and (or gnus-newsrc-alist gnus-killed-list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16889 gnus-current-startup-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16890 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16891 (if (and (or gnus-use-dribble-file gnus-slave)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16892 (not force)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16893 (or (not gnus-dribble-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16894 (not (buffer-name gnus-dribble-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16895 (zerop (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16896 (set-buffer gnus-dribble-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16897 (buffer-size)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16898 (gnus-message 4 "(No changes need to be saved)")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16899 (run-hooks 'gnus-save-newsrc-hook)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16900 (if gnus-slave
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16901 (gnus-slave-save-newsrc)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16902 ;; Save .newsrc.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16903 (when gnus-save-newsrc-file
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16904 (gnus-message 5 "Saving %s..." gnus-current-startup-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16905 (gnus-gnus-to-newsrc-format)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16906 (gnus-message 5 "Saving %s...done" gnus-current-startup-file))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16907 ;; Save .newsrc.eld.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16908 (set-buffer (get-buffer-create " *Gnus-newsrc*"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16909 (make-local-variable 'version-control)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16910 (setq version-control 'never)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16911 (setq buffer-file-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16912 (concat gnus-current-startup-file ".eld"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16913 (setq default-directory (file-name-directory buffer-file-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16914 (gnus-add-current-to-buffer-list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16915 (buffer-disable-undo (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16916 (erase-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16917 (gnus-message 5 "Saving %s.eld..." gnus-current-startup-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16918 (gnus-gnus-to-quick-newsrc-format)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16919 (run-hooks 'gnus-save-quick-newsrc-hook)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16920 (save-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16921 (kill-buffer (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16922 (gnus-message
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16923 5 "Saving %s.eld...done" gnus-current-startup-file))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16924 (gnus-dribble-delete-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16925 (gnus-group-set-mode-line)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16926
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16927 (defun gnus-gnus-to-quick-newsrc-format ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16928 "Insert Gnus variables such as gnus-newsrc-alist in lisp format."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16929 (insert ";; Gnus startup file.\n")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16930 (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
16931 (insert ";; to read .newsrc.\n")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16932 (insert "(setq gnus-newsrc-file-version "
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16933 (prin1-to-string gnus-version) ")\n")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16934 (let ((variables
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16935 (if gnus-save-killed-list gnus-variable-list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16936 ;; Remove the `gnus-killed-list' from the list of variables
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16937 ;; to be saved, if required.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16938 (delq 'gnus-killed-list (copy-sequence gnus-variable-list))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16939 ;; Peel off the "dummy" group.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16940 (gnus-newsrc-alist (cdr gnus-newsrc-alist))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16941 variable)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16942 ;; Insert the variables into the file.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16943 (while variables
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16944 (when (and (boundp (setq variable (pop variables)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16945 (symbol-value variable))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16946 (insert "(setq " (symbol-name variable) " '")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16947 (prin1 (symbol-value variable) (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16948 (insert ")\n")))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16949
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16950 (defun gnus-gnus-to-newsrc-format ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16951 ;; Generate and save the .newsrc file.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16952 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16953 (set-buffer (create-file-buffer gnus-current-startup-file))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16954 (let ((newsrc (cdr gnus-newsrc-alist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16955 (standard-output (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16956 info ranges range method)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16957 (setq buffer-file-name gnus-current-startup-file)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16958 (setq default-directory (file-name-directory buffer-file-name))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16959 (buffer-disable-undo (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16960 (erase-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16961 ;; Write options.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16962 (if gnus-newsrc-options (insert gnus-newsrc-options))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16963 ;; Write subscribed and unsubscribed.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16964 (while (setq info (pop newsrc))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16965 ;; Don't write foreign groups to .newsrc.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16966 (when (or (null (setq method (gnus-info-method info)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16967 (equal method "native")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16968 (gnus-server-equal method gnus-select-method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16969 (insert (gnus-info-group info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16970 (if (> (gnus-info-level info) gnus-level-subscribed)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16971 "!" ":"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16972 (when (setq ranges (gnus-info-read info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16973 (insert " ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16974 (if (not (listp (cdr ranges)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16975 (if (= (car ranges) (cdr ranges))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16976 (princ (car 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 (insert "-")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16979 (princ (cdr ranges)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16980 (while (setq range (pop ranges))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16981 (if (or (atom range) (= (car range) (cdr range)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16982 (princ (or (and (atom range) range) (car range)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16983 (princ (car range))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16984 (insert "-")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16985 (princ (cdr range)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16986 (if ranges (insert ",")))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16987 (insert "\n")))
14477
7da7619a6150 (gnus-gnus-to-newsrc-format): Turn off version-control
Richard M. Stallman <rms@gnu.org>
parents: 14359
diff changeset
16988 (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
16989 (setq version-control 'never)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16990 ;; 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
16991 ;; 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
16992 ;; 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
16993 ;; though...
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16994 ;; sometimes the modtime clear isn't sufficient. most brute force:
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16995 ;; delete the silly thing entirely first. but this fails to provide
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16996 ;; such niceties as .newsrc~ creation.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16997 (if gnus-modtime-botch
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16998 (delete-file gnus-startup-file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16999 (clear-visited-file-modtime))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17000 (run-hooks 'gnus-save-standard-newsrc-hook)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17001 (save-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17002 (kill-buffer (current-buffer)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17003
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17004
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 ;;; Slave functions.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17007 ;;;
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 (defun gnus-slave-save-newsrc ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17010 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17011 (set-buffer gnus-dribble-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17012 (let ((slave-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17013 (make-temp-name (concat gnus-current-startup-file "-slave-"))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17014 (write-region (point-min) (point-max) slave-name nil 'nomesg))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17015
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17016 (defun gnus-master-read-slave-newsrc ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17017 (let ((slave-files
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17018 (directory-files
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17019 (file-name-directory gnus-current-startup-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17020 t (concat
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17021 "^" (regexp-quote
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17022 (concat
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17023 (file-name-nondirectory gnus-current-startup-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17024 "-slave-")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17025 t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17026 file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17027 (if (not slave-files)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17028 () ; There are no slave files to read.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17029 (gnus-message 7 "Reading slave newsrcs...")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17030 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17031 (set-buffer (get-buffer-create " *gnus slave*"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17032 (buffer-disable-undo (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17033 (setq slave-files
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17034 (sort (mapcar (lambda (file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17035 (list (nth 5 (file-attributes file)) file))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17036 slave-files)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17037 (lambda (f1 f2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17038 (or (< (caar f1) (caar f2))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17039 (< (nth 1 (car f1)) (nth 1 (car f2)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17040 (while slave-files
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17041 (erase-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17042 (setq file (nth 1 (car slave-files)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17043 (insert-file-contents file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17044 (if (condition-case ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17045 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17046 (eval-buffer (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17047 t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17048 (error
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17049 (gnus-error 3.2 "Possible error in %s" file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17050 nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17051 (or gnus-slave ; Slaves shouldn't delete these files.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17052 (condition-case ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17053 (delete-file file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17054 (error nil))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17055 (setq slave-files (cdr slave-files))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17056 (gnus-message 7 "Reading slave newsrcs...done"))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17057
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 ;;; Group description.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17061 ;;;
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17062
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17063 (defun gnus-read-all-descriptions-files ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17064 (let ((methods (cons gnus-select-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17065 (nconc
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
17066 (when (gnus-archive-server-wanted-p)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17067 (list "archive"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17068 gnus-secondary-select-methods))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17069 (while methods
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17070 (gnus-read-descriptions-file (car methods))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17071 (setq methods (cdr methods)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17072 t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17073
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17074 (defun gnus-read-descriptions-file (&optional method)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17075 (let ((method (or method gnus-select-method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17076 group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17077 (when (stringp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17078 (setq method (gnus-server-to-method method)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17079 ;; 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
17080 ;; to avoid trying to re-read after a failed read.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17081 (or gnus-description-hashtb
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17082 (setq gnus-description-hashtb
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17083 (gnus-make-hashtable (length gnus-active-hashtb))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17084 ;; Mark this method's desc file as read.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17085 (gnus-sethash (gnus-group-prefixed-name "" method) "Has read"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17086 gnus-description-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17087
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17088 (gnus-message 5 "Reading descriptions file via %s..." (car method))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17089 (cond
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17090 ((not (gnus-check-server method))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17091 (gnus-message 1 "Couldn't open server")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17092 nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17093 ((not (gnus-request-list-newsgroups method))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17094 (gnus-message 1 "Couldn't read newsgroups descriptions")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17095 nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17096 (t
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17097 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17098 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17099 (set-buffer nntp-server-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17100 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17101 (when (or (search-forward "\n.\n" nil t)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17102 (goto-char (point-max)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17103 (beginning-of-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17104 (narrow-to-region (point-min) (point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17105 ;; 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
17106 ;; group prefix in front of the group names.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17107 (and method (not (gnus-server-equal
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17108 (gnus-server-get-method nil method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17109 (gnus-server-get-method nil gnus-select-method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17110 (let ((prefix (gnus-group-prefixed-name "" method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17111 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17112 (while (and (not (eobp))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17113 (progn (insert prefix)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17114 (zerop (forward-line 1)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17115 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17116 (while (not (eobp))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17117 ;; 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
17118 ;; symbol...
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17119 (setq group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17120 (condition-case ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17121 (let ((obarray gnus-description-hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17122 ;; Group is set to a symbol interned in this
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17123 ;; hash table.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17124 (read nntp-server-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17125 (error 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17126 (skip-chars-forward " \t")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17127 ;; ... which leads to this line being effectively ignored.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17128 (and (symbolp group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17129 (set group (buffer-substring
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17130 (point) (progn (end-of-line) (point)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17131 (forward-line 1))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17132 (gnus-message 5 "Reading descriptions file...done")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17133 t))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17134
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17135 (defun gnus-group-get-description (group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17136 "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
17137 (when (gnus-request-group-description group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17138 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17139 (set-buffer nntp-server-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17140 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17141 (when (looking-at "[^ \t]+[ \t]+\\(.*\\)")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17142 (match-string 1)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17143
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17144
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17145 ;;;
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17146 ;;; Buffering of read articles.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17147 ;;;
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17148
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17149 (defvar gnus-backlog-buffer " *Gnus Backlog*")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17150 (defvar gnus-backlog-articles nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17151 (defvar gnus-backlog-hashtb nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17152
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17153 (defun gnus-backlog-buffer ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17154 "Return the backlog buffer."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17155 (or (get-buffer gnus-backlog-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17156 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17157 (set-buffer (get-buffer-create gnus-backlog-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17158 (buffer-disable-undo (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17159 (setq buffer-read-only t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17160 (gnus-add-current-to-buffer-list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17161 (get-buffer gnus-backlog-buffer))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17162
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17163 (defun gnus-backlog-setup ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17164 "Initialize backlog variables."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17165 (unless gnus-backlog-hashtb
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17166 (setq gnus-backlog-hashtb (make-vector 1023 0))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17167
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17168 (gnus-add-shutdown 'gnus-backlog-shutdown 'gnus)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17169
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17170 (defun gnus-backlog-shutdown ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17171 "Clear all backlog variables and buffers."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17172 (when (get-buffer gnus-backlog-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17173 (kill-buffer gnus-backlog-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17174 (setq gnus-backlog-hashtb nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17175 gnus-backlog-articles nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17176
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17177 (defun gnus-backlog-enter-article (group number buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17178 (gnus-backlog-setup)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17179 (let ((ident (intern (concat group ":" (int-to-string number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17180 gnus-backlog-hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17181 b)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17182 (if (memq ident gnus-backlog-articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17183 () ; It's already kept.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17184 ;; Remove the oldest article, if necessary.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17185 (and (numberp gnus-keep-backlog)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17186 (>= (length gnus-backlog-articles) gnus-keep-backlog)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17187 (gnus-backlog-remove-oldest-article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17188 (setq gnus-backlog-articles (cons ident gnus-backlog-articles))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17189 ;; Insert the new article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17190 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17191 (set-buffer (gnus-backlog-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17192 (let (buffer-read-only)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17193 (goto-char (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17194 (or (bolp) (insert "\n"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17195 (setq b (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17196 (insert-buffer-substring buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17197 ;; Tag the beginning of the article with the ident.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17198 (gnus-put-text-property b (1+ b) 'gnus-backlog ident))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17199
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17200 (defun gnus-backlog-remove-oldest-article ()
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17201 (save-excursion
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17202 (set-buffer (gnus-backlog-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17203 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17204 (if (zerop (buffer-size))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17205 () ; The buffer is empty.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17206 (let ((ident (get-text-property (point) 'gnus-backlog))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17207 buffer-read-only)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17208 ;; Remove the ident from the list of articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17209 (when ident
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17210 (setq gnus-backlog-articles (delq ident gnus-backlog-articles)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17211 ;; Delete the article itself.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17212 (delete-region
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17213 (point) (next-single-property-change
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17214 (1+ (point)) 'gnus-backlog nil (point-max)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17215
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17216 (defun gnus-backlog-remove-article (group number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17217 "Remove article NUMBER in GROUP from the backlog."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17218 (when (numberp number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17219 (gnus-backlog-setup)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17220 (let ((ident (intern (concat group ":" (int-to-string number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17221 gnus-backlog-hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17222 beg end)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17223 (when (memq ident gnus-backlog-articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17224 ;; It was in the backlog.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17225 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17226 (set-buffer (gnus-backlog-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17227 (let (buffer-read-only)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17228 (when (setq beg (text-property-any
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17229 (point-min) (point-max) 'gnus-backlog
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17230 ident))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17231 ;; Find the end (i. e., the beginning of the next article).
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17232 (setq end
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17233 (next-single-property-change
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17234 (1+ beg) 'gnus-backlog (current-buffer) (point-max)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17235 (delete-region beg end)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17236 ;; Return success.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17237 t)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17238
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17239 (defun gnus-backlog-request-article (group number buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17240 (when (numberp number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17241 (gnus-backlog-setup)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17242 (let ((ident (intern (concat group ":" (int-to-string number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17243 gnus-backlog-hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17244 beg end)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17245 (when (memq ident gnus-backlog-articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17246 ;; It was in the backlog.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17247 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17248 (set-buffer (gnus-backlog-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17249 (if (not (setq beg (text-property-any
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17250 (point-min) (point-max) 'gnus-backlog
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17251 ident)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17252 ;; It wasn't in the backlog after all.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17253 (ignore
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17254 (setq gnus-backlog-articles (delq ident gnus-backlog-articles)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17255 ;; Find the end (i. e., the beginning of the next article).
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17256 (setq end
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17257 (next-single-property-change
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17258 (1+ beg) 'gnus-backlog (current-buffer) (point-max)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17259 (let ((buffer-read-only nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17260 (erase-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17261 (insert-buffer-substring gnus-backlog-buffer beg end)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17262 t)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17263
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17264 ;; Allow redefinition of Gnus functions.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17265
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17266 (gnus-ems-redefine)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17267
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17268 (provide 'gnus)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17269
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17270 ;;; gnus.el ends here