Mercurial > emacs
annotate lisp/gnus/gnus-int.el @ 112401:e80422318be4
gnus-art.el (gnus-mime-display-single): Use mm-display-inline rather than mm-insert-inline.
author | Katsumi Yamaoka <yamaoka@jpl.org> |
---|---|
date | Fri, 21 Jan 2011 23:33:46 +0000 |
parents | 700b890dcfb5 |
children |
rev | line source |
---|---|
17493 | 1 ;;; gnus-int.el --- backend interface functions for Gnus |
64754
fafd692d1e40
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64085
diff
changeset
|
2 |
fafd692d1e40
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64085
diff
changeset
|
3 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 |
112193
700b890dcfb5
proto-stream.el (open-protocol-stream): Protect against the low-level transport functions returning nil.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111986
diff
changeset
|
4 ;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. |
17493 | 5 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> |
17493 | 7 ;; Keywords: news |
8 | |
9 ;; This file is part of GNU Emacs. | |
10 | |
94662
f42ef85caf91
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
11 ;; GNU Emacs is free software: you can redistribute it and/or modify |
17493 | 12 ;; it under the terms of the GNU General Public License as published by |
94662
f42ef85caf91
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
13 ;; the Free Software Foundation, either version 3 of the License, or |
f42ef85caf91
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
14 ;; (at your option) any later version. |
17493 | 15 |
16 ;; GNU Emacs is distributed in the hope that it will be useful, | |
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
94662
f42ef85caf91
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
17493 | 19 ;; GNU General Public License for more details. |
20 | |
21 ;; You should have received a copy of the GNU General Public License | |
94662
f42ef85caf91
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
17493 | 23 |
24 ;;; Commentary: | |
25 | |
26 ;;; Code: | |
27 | |
19531
f5b98be7c142
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
28 (eval-when-compile (require 'cl)) |
f5b98be7c142
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
29 |
17493 | 30 (require 'gnus) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
31 (require 'message) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
32 (require 'gnus-range) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
33 |
110915
d0d0047ca0fb
gnus-int.el (gnus-run-hook-with-args): Autoload from gnus-util.el.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110799
diff
changeset
|
34 (autoload 'gnus-run-hook-with-args "gnus-util") |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
35 (autoload 'gnus-agent-expire "gnus-agent") |
57617
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57153
diff
changeset
|
36 (autoload 'gnus-agent-regenerate-group "gnus-agent") |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
37 (autoload 'gnus-agent-read-servers-validate-native "gnus-agent") |
87097 | 38 (autoload 'gnus-agent-possibly-synchronize-flags-server "gnus-agent") |
17493 | 39 |
40 (defcustom gnus-open-server-hook nil | |
41 "Hook called just before opening connection to the news server." | |
42 :group 'gnus-start | |
43 :type 'hook) | |
44 | |
110799
d2b45bb936b6
gnus-int.el, gnus-util.el: Gnus hooks for the mark get/set operations.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110661
diff
changeset
|
45 (defcustom gnus-after-set-mark-hook nil |
d2b45bb936b6
gnus-int.el, gnus-util.el: Gnus hooks for the mark get/set operations.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110661
diff
changeset
|
46 "Hook called just after marks are set in a group." |
d2b45bb936b6
gnus-int.el, gnus-util.el: Gnus hooks for the mark get/set operations.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110661
diff
changeset
|
47 :group 'gnus-start |
d2b45bb936b6
gnus-int.el, gnus-util.el: Gnus hooks for the mark get/set operations.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110661
diff
changeset
|
48 :type 'hook) |
d2b45bb936b6
gnus-int.el, gnus-util.el: Gnus hooks for the mark get/set operations.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110661
diff
changeset
|
49 |
d2b45bb936b6
gnus-int.el, gnus-util.el: Gnus hooks for the mark get/set operations.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110661
diff
changeset
|
50 (defcustom gnus-before-update-mark-hook nil |
d2b45bb936b6
gnus-int.el, gnus-util.el: Gnus hooks for the mark get/set operations.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110661
diff
changeset
|
51 "Hook called just before marks are updated in a group." |
d2b45bb936b6
gnus-int.el, gnus-util.el: Gnus hooks for the mark get/set operations.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110661
diff
changeset
|
52 :group 'gnus-start |
d2b45bb936b6
gnus-int.el, gnus-util.el: Gnus hooks for the mark get/set operations.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110661
diff
changeset
|
53 :type 'hook) |
d2b45bb936b6
gnus-int.el, gnus-util.el: Gnus hooks for the mark get/set operations.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110661
diff
changeset
|
54 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
55 (defcustom gnus-server-unopen-status nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
56 "The default status if the server is not able to open. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
57 If the server is covered by Gnus agent, the possible values are |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
58 `denied', set the server denied; `offline', set the server offline; |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
59 nil, ask user. If the server is not covered by Gnus agent, set the |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
60 server denied." |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
57617
diff
changeset
|
61 :version "22.1" |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
62 :group 'gnus-start |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
63 :type '(choice (const :tag "Ask" nil) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
64 (const :tag "Deny server" denied) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
65 (const :tag "Unplug Agent" offline))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
66 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
67 (defvar gnus-internal-registry-spool-current-method nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
68 "The current method, for the registry.") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
69 |
87249
cd9c122de2ca
(gnus-server-opened, gnus-status-message): Move definitions before use.
Glenn Morris <rgm@gnu.org>
parents:
87097
diff
changeset
|
70 |
cd9c122de2ca
(gnus-server-opened, gnus-status-message): Move definitions before use.
Glenn Morris <rgm@gnu.org>
parents:
87097
diff
changeset
|
71 (defun gnus-server-opened (gnus-command-method) |
cd9c122de2ca
(gnus-server-opened, gnus-status-message): Move definitions before use.
Glenn Morris <rgm@gnu.org>
parents:
87097
diff
changeset
|
72 "Check whether a connection to GNUS-COMMAND-METHOD has been opened." |
cd9c122de2ca
(gnus-server-opened, gnus-status-message): Move definitions before use.
Glenn Morris <rgm@gnu.org>
parents:
87097
diff
changeset
|
73 (unless (eq (gnus-server-status gnus-command-method) |
cd9c122de2ca
(gnus-server-opened, gnus-status-message): Move definitions before use.
Glenn Morris <rgm@gnu.org>
parents:
87097
diff
changeset
|
74 'denied) |
cd9c122de2ca
(gnus-server-opened, gnus-status-message): Move definitions before use.
Glenn Morris <rgm@gnu.org>
parents:
87097
diff
changeset
|
75 (when (stringp gnus-command-method) |
cd9c122de2ca
(gnus-server-opened, gnus-status-message): Move definitions before use.
Glenn Morris <rgm@gnu.org>
parents:
87097
diff
changeset
|
76 (setq gnus-command-method (gnus-server-to-method gnus-command-method))) |
cd9c122de2ca
(gnus-server-opened, gnus-status-message): Move definitions before use.
Glenn Morris <rgm@gnu.org>
parents:
87097
diff
changeset
|
77 (funcall (inline (gnus-get-function gnus-command-method 'server-opened)) |
cd9c122de2ca
(gnus-server-opened, gnus-status-message): Move definitions before use.
Glenn Morris <rgm@gnu.org>
parents:
87097
diff
changeset
|
78 (nth 1 gnus-command-method)))) |
cd9c122de2ca
(gnus-server-opened, gnus-status-message): Move definitions before use.
Glenn Morris <rgm@gnu.org>
parents:
87097
diff
changeset
|
79 |
cd9c122de2ca
(gnus-server-opened, gnus-status-message): Move definitions before use.
Glenn Morris <rgm@gnu.org>
parents:
87097
diff
changeset
|
80 (defun gnus-status-message (gnus-command-method) |
cd9c122de2ca
(gnus-server-opened, gnus-status-message): Move definitions before use.
Glenn Morris <rgm@gnu.org>
parents:
87097
diff
changeset
|
81 "Return the status message from GNUS-COMMAND-METHOD. |
cd9c122de2ca
(gnus-server-opened, gnus-status-message): Move definitions before use.
Glenn Morris <rgm@gnu.org>
parents:
87097
diff
changeset
|
82 If GNUS-COMMAND-METHOD is a string, it is interpreted as a group |
cd9c122de2ca
(gnus-server-opened, gnus-status-message): Move definitions before use.
Glenn Morris <rgm@gnu.org>
parents:
87097
diff
changeset
|
83 name. The method this group uses will be queried." |
cd9c122de2ca
(gnus-server-opened, gnus-status-message): Move definitions before use.
Glenn Morris <rgm@gnu.org>
parents:
87097
diff
changeset
|
84 (let ((gnus-command-method |
cd9c122de2ca
(gnus-server-opened, gnus-status-message): Move definitions before use.
Glenn Morris <rgm@gnu.org>
parents:
87097
diff
changeset
|
85 (if (stringp gnus-command-method) |
cd9c122de2ca
(gnus-server-opened, gnus-status-message): Move definitions before use.
Glenn Morris <rgm@gnu.org>
parents:
87097
diff
changeset
|
86 (gnus-find-method-for-group gnus-command-method) |
cd9c122de2ca
(gnus-server-opened, gnus-status-message): Move definitions before use.
Glenn Morris <rgm@gnu.org>
parents:
87097
diff
changeset
|
87 gnus-command-method))) |
cd9c122de2ca
(gnus-server-opened, gnus-status-message): Move definitions before use.
Glenn Morris <rgm@gnu.org>
parents:
87097
diff
changeset
|
88 (funcall (gnus-get-function gnus-command-method 'status-message) |
cd9c122de2ca
(gnus-server-opened, gnus-status-message): Move definitions before use.
Glenn Morris <rgm@gnu.org>
parents:
87097
diff
changeset
|
89 (nth 1 gnus-command-method)))) |
cd9c122de2ca
(gnus-server-opened, gnus-status-message): Move definitions before use.
Glenn Morris <rgm@gnu.org>
parents:
87097
diff
changeset
|
90 |
17493 | 91 ;;; |
92 ;;; Server Communication | |
93 ;;; | |
94 | |
95 (defun gnus-start-news-server (&optional confirm) | |
96 "Open a method for getting news. | |
97 If CONFIRM is non-nil, the user will be asked for an NNTP server." | |
98 (let (how) | |
99 (if gnus-current-select-method | |
100 ;; Stream is already opened. | |
101 nil | |
102 ;; Open NNTP server. | |
103 (when confirm | |
104 ;; Read server name with completion. | |
105 (setq gnus-nntp-server | |
110661
2b8ece636433
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110583
diff
changeset
|
106 (gnus-completing-read "NNTP server" |
2b8ece636433
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110583
diff
changeset
|
107 (cons gnus-nntp-server |
2b8ece636433
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110583
diff
changeset
|
108 gnus-secondary-servers) |
2b8ece636433
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110583
diff
changeset
|
109 nil gnus-nntp-server))) |
17493 | 110 |
111 (when (and gnus-nntp-server | |
112 (stringp gnus-nntp-server) | |
113 (not (string= gnus-nntp-server ""))) | |
114 (setq gnus-select-method | |
115 (cond ((or (string= gnus-nntp-server "") | |
116 (string= gnus-nntp-server "::")) | |
117 (list 'nnspool (system-name))) | |
118 ((string-match "^:" gnus-nntp-server) | |
119 (list 'nnmh gnus-nntp-server | |
120 (list 'nnmh-directory | |
121 (file-name-as-directory | |
122 (expand-file-name | |
33377
e16be74deee2
(gnus-start-news-server): Use expand-file-name, not
Dave Love <fx@gnu.org>
parents:
31716
diff
changeset
|
123 (substring gnus-nntp-server 1) "~/"))) |
17493 | 124 (list 'nnmh-get-new-mail nil))) |
125 (t | |
126 (list 'nntp gnus-nntp-server))))) | |
127 | |
128 (setq how (car gnus-select-method)) | |
129 (cond | |
130 ((eq how 'nnspool) | |
131 (require 'nnspool) | |
132 (gnus-message 5 "Looking up local news spool...")) | |
133 ((eq how 'nnmh) | |
134 (require 'nnmh) | |
135 (gnus-message 5 "Looking up mh spool...")) | |
136 (t | |
137 (require 'nntp))) | |
138 (setq gnus-current-select-method gnus-select-method) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
139 (gnus-run-hooks 'gnus-open-server-hook) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
140 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
141 ;; Partially validate agent covered methods now that the |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
142 ;; gnus-select-method is known. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
143 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
144 (if gnus-agent |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
145 ;; NOTE: This is here for one purpose only. By validating |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
146 ;; the current select method, it converts the old 5.10.3, |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
147 ;; and earlier, format to the current format. That enables |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
148 ;; the agent code within gnus-open-server to function |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
149 ;; correctly. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
150 (gnus-agent-read-servers-validate-native gnus-select-method)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
151 |
17493 | 152 (or |
153 ;; gnus-open-server-hook might have opened it | |
154 (gnus-server-opened gnus-select-method) | |
155 (gnus-open-server gnus-select-method) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
156 gnus-batch-mode |
17493 | 157 (gnus-y-or-n-p |
158 (format | |
159 "%s (%s) open error: '%s'. Continue? " | |
160 (car gnus-select-method) (cadr gnus-select-method) | |
161 (gnus-status-message gnus-select-method))) | |
162 (gnus-error 1 "Couldn't open server on %s" | |
163 (nth 1 gnus-select-method)))))) | |
164 | |
165 (defun gnus-check-group (group) | |
166 "Try to make sure that the server where GROUP exists is alive." | |
167 (let ((method (gnus-find-method-for-group group))) | |
168 (or (gnus-server-opened method) | |
169 (gnus-open-server method)))) | |
170 | |
171 (defun gnus-check-server (&optional method silent) | |
172 "Check whether the connection to METHOD is down. | |
173 If METHOD is nil, use `gnus-select-method'. | |
174 If it is down, start it up (again)." | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
175 (let ((method (or method gnus-select-method)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
176 result) |
17493 | 177 ;; Transform virtual server names into select methods. |
178 (when (stringp method) | |
179 (setq method (gnus-server-to-method method))) | |
180 (if (gnus-server-opened method) | |
181 ;; The stream is already opened. | |
182 t | |
183 ;; Open the server. | |
184 (unless silent | |
185 (gnus-message 5 "Opening %s server%s..." (car method) | |
186 (if (equal (nth 1 method) "") "" | |
187 (format " on %s" (nth 1 method))))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
188 (gnus-run-hooks 'gnus-open-server-hook) |
17493 | 189 (prog1 |
110410
f2e111723c3a
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110199
diff
changeset
|
190 (setq result (gnus-open-server method)) |
17493 | 191 (unless silent |
110583
b6d2a63ad993
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110516
diff
changeset
|
192 (gnus-message |
b6d2a63ad993
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110516
diff
changeset
|
193 (if result 5 3) |
b6d2a63ad993
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110516
diff
changeset
|
194 "Opening %s server%s...%s" (car method) |
b6d2a63ad993
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110516
diff
changeset
|
195 (if (equal (nth 1 method) "") "" |
b6d2a63ad993
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110516
diff
changeset
|
196 (format " on %s" (nth 1 method))) |
b6d2a63ad993
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110516
diff
changeset
|
197 (if result |
b6d2a63ad993
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110516
diff
changeset
|
198 "done" |
b6d2a63ad993
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110516
diff
changeset
|
199 (format "failed: %s" |
b6d2a63ad993
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110516
diff
changeset
|
200 (nnheader-get-report-string (car method)))))))))) |
17493 | 201 |
202 (defun gnus-get-function (method function &optional noerror) | |
203 "Return a function symbol based on METHOD and FUNCTION." | |
204 ;; Translate server names into methods. | |
205 (unless method | |
206 (error "Attempted use of a nil select method")) | |
207 (when (stringp method) | |
208 (setq method (gnus-server-to-method method))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
209 ;; Check cache of constructed names. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
210 (let* ((method-sym (if gnus-agent |
57617
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57153
diff
changeset
|
211 (inline (gnus-agent-get-function method)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
212 (car method))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
213 (method-fns (get method-sym 'gnus-method-functions)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
214 (func (let ((method-fnlist-elt (assq function method-fns))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
215 (unless method-fnlist-elt |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
216 (setq method-fnlist-elt |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
217 (cons function |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
218 (intern (format "%s-%s" method-sym function)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
219 (put method-sym 'gnus-method-functions |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
220 (cons method-fnlist-elt method-fns))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
221 (cdr method-fnlist-elt)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
222 ;; Maybe complain if there is no function. |
17493 | 223 (unless (fboundp func) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
224 (unless (car method) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
225 (error "Trying to require a method that doesn't exist")) |
17493 | 226 (require (car method)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
227 (when (not (fboundp func)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
228 (if noerror |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
229 (setq func nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
230 (error "No such function: %s" func)))) |
17493 | 231 func)) |
232 | |
233 | |
234 ;;; | |
235 ;;; Interface functions to the backends. | |
236 ;;; | |
237 | |
110410
f2e111723c3a
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110199
diff
changeset
|
238 (defun gnus-method-denied-p (method) |
f2e111723c3a
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110199
diff
changeset
|
239 (eq (nth 1 (assoc method gnus-opened-servers)) |
f2e111723c3a
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110199
diff
changeset
|
240 'denied)) |
f2e111723c3a
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110199
diff
changeset
|
241 |
110486
1ad1adb298a3
Merge Changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110465
diff
changeset
|
242 (defvar gnus-backend-trace t) |
1ad1adb298a3
Merge Changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110465
diff
changeset
|
243 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
244 (defun gnus-open-server (gnus-command-method) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
245 "Open a connection to GNUS-COMMAND-METHOD." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
246 (when (stringp gnus-command-method) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
247 (setq gnus-command-method (gnus-server-to-method gnus-command-method))) |
110486
1ad1adb298a3
Merge Changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110465
diff
changeset
|
248 (when gnus-backend-trace |
1ad1adb298a3
Merge Changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110465
diff
changeset
|
249 (with-current-buffer (get-buffer-create "*gnus trace*") |
1ad1adb298a3
Merge Changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110465
diff
changeset
|
250 (buffer-disable-undo) |
1ad1adb298a3
Merge Changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110465
diff
changeset
|
251 (goto-char (point-max)) |
1ad1adb298a3
Merge Changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110465
diff
changeset
|
252 (insert (format-time-string "%H:%M:%S") |
1ad1adb298a3
Merge Changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110465
diff
changeset
|
253 (format " %S\n" gnus-command-method)))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
254 (let ((elem (assoc gnus-command-method gnus-opened-servers)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
255 (server (gnus-method-to-server-name gnus-command-method))) |
17493 | 256 ;; If this method was previously denied, we just return nil. |
257 (if (eq (nth 1 elem) 'denied) | |
258 (progn | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
259 (gnus-message 1 "Denied server %s" server) |
17493 | 260 nil) |
261 ;; Open the server. | |
111830
79219ca01c7b
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111430
diff
changeset
|
262 (let* ((open-server-function |
79219ca01c7b
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111430
diff
changeset
|
263 (gnus-get-function gnus-command-method 'open-server)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
264 (result |
111830
79219ca01c7b
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111430
diff
changeset
|
265 (condition-case err |
79219ca01c7b
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111430
diff
changeset
|
266 (funcall open-server-function |
79219ca01c7b
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111430
diff
changeset
|
267 (nth 1 gnus-command-method) |
79219ca01c7b
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111430
diff
changeset
|
268 (nthcdr 2 gnus-command-method)) |
79219ca01c7b
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111430
diff
changeset
|
269 (error |
79219ca01c7b
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111430
diff
changeset
|
270 (gnus-message 1 "Unable to open server %s due to: %s" |
79219ca01c7b
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111430
diff
changeset
|
271 server (error-message-string err)) |
79219ca01c7b
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111430
diff
changeset
|
272 nil) |
79219ca01c7b
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111430
diff
changeset
|
273 (quit |
79219ca01c7b
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111430
diff
changeset
|
274 (gnus-message 1 "Quit trying to open server %s" server) |
79219ca01c7b
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111430
diff
changeset
|
275 nil))) |
79219ca01c7b
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111430
diff
changeset
|
276 open-offline) |
17493 | 277 ;; If this hasn't been opened before, we add it to the list. |
278 (unless elem | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
279 (setq elem (list gnus-command-method nil) |
17493 | 280 gnus-opened-servers (cons elem gnus-opened-servers))) |
281 ;; Set the status of this server. | |
110583
b6d2a63ad993
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110516
diff
changeset
|
282 (setcar |
b6d2a63ad993
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110516
diff
changeset
|
283 (cdr elem) |
b6d2a63ad993
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110516
diff
changeset
|
284 (cond (result |
b6d2a63ad993
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110516
diff
changeset
|
285 (if (eq open-server-function #'nnagent-open-server) |
b6d2a63ad993
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110516
diff
changeset
|
286 ;; The agent's backend has a "special" status |
b6d2a63ad993
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110516
diff
changeset
|
287 'offline |
b6d2a63ad993
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110516
diff
changeset
|
288 'ok)) |
b6d2a63ad993
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110516
diff
changeset
|
289 ((and gnus-agent |
b6d2a63ad993
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110516
diff
changeset
|
290 (gnus-agent-method-p gnus-command-method)) |
b6d2a63ad993
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110516
diff
changeset
|
291 (cond |
b6d2a63ad993
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110516
diff
changeset
|
292 (gnus-server-unopen-status |
b6d2a63ad993
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110516
diff
changeset
|
293 ;; Set the server's status to the unopen |
b6d2a63ad993
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110516
diff
changeset
|
294 ;; status. If that status is offline, |
b6d2a63ad993
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110516
diff
changeset
|
295 ;; recurse to open the agent's backend. |
b6d2a63ad993
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110516
diff
changeset
|
296 (setq open-offline (eq gnus-server-unopen-status 'offline)) |
b6d2a63ad993
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110516
diff
changeset
|
297 gnus-server-unopen-status) |
b6d2a63ad993
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110516
diff
changeset
|
298 ((not gnus-batch-mode) |
b6d2a63ad993
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110516
diff
changeset
|
299 (setq open-offline t) |
b6d2a63ad993
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110516
diff
changeset
|
300 'offline) |
b6d2a63ad993
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110516
diff
changeset
|
301 (t |
b6d2a63ad993
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110516
diff
changeset
|
302 ;; This agentized server was still denied |
b6d2a63ad993
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110516
diff
changeset
|
303 'denied))) |
b6d2a63ad993
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110516
diff
changeset
|
304 (t |
b6d2a63ad993
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110516
diff
changeset
|
305 ;; This unagentized server must be denied |
b6d2a63ad993
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110516
diff
changeset
|
306 'denied))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
307 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
308 ;; NOTE: I MUST set the server's status to offline before this |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
309 ;; recursive call as this status will drive the |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
310 ;; gnus-get-function (called above) to return the agent's |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
311 ;; backend. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
312 (if open-offline |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
313 ;; Recursively open this offline server to perform the |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
314 ;; open-server function of the agent's backend. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
315 (let ((gnus-server-unopen-status 'denied)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
316 ;; Bind gnus-server-unopen-status to avoid recursively |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
317 ;; prompting with "go offline?". This is only a concern |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
318 ;; when the agent's backend fails to open the server. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
319 (gnus-open-server gnus-command-method)) |
87097 | 320 (when (and (eq (cadr elem) 'ok) gnus-agent |
321 (gnus-agent-method-p gnus-command-method)) | |
322 (save-excursion | |
323 (gnus-agent-possibly-synchronize-flags-server | |
324 gnus-command-method))) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
325 result))))) |
17493 | 326 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
327 (defun gnus-close-server (gnus-command-method) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
328 "Close the connection to GNUS-COMMAND-METHOD." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
329 (when (stringp gnus-command-method) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
330 (setq gnus-command-method (gnus-server-to-method gnus-command-method))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
331 (funcall (gnus-get-function gnus-command-method 'close-server) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
332 (nth 1 gnus-command-method))) |
17493 | 333 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
334 (defun gnus-request-list (gnus-command-method) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
335 "Request the active file from GNUS-COMMAND-METHOD." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
336 (when (stringp gnus-command-method) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
337 (setq gnus-command-method (gnus-server-to-method gnus-command-method))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
338 (funcall (gnus-get-function gnus-command-method 'request-list) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
339 (nth 1 gnus-command-method))) |
17493 | 340 |
110410
f2e111723c3a
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110199
diff
changeset
|
341 (defun gnus-finish-retrieve-group-infos (gnus-command-method infos data) |
f2e111723c3a
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110199
diff
changeset
|
342 "Read and update infos from GNUS-COMMAND-METHOD." |
f2e111723c3a
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110199
diff
changeset
|
343 (when (stringp gnus-command-method) |
f2e111723c3a
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110199
diff
changeset
|
344 (setq gnus-command-method (gnus-server-to-method gnus-command-method))) |
f2e111723c3a
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110199
diff
changeset
|
345 (funcall (gnus-get-function gnus-command-method 'finish-retrieve-group-infos) |
f2e111723c3a
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110199
diff
changeset
|
346 (nth 1 gnus-command-method) |
f2e111723c3a
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110199
diff
changeset
|
347 infos data)) |
f2e111723c3a
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110199
diff
changeset
|
348 |
f2e111723c3a
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110199
diff
changeset
|
349 (defun gnus-retrieve-group-data-early (gnus-command-method infos) |
f2e111723c3a
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110199
diff
changeset
|
350 "Start early async retrival of data from GNUS-COMMAND-METHOD." |
f2e111723c3a
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110199
diff
changeset
|
351 (when (stringp gnus-command-method) |
f2e111723c3a
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110199
diff
changeset
|
352 (setq gnus-command-method (gnus-server-to-method gnus-command-method))) |
f2e111723c3a
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110199
diff
changeset
|
353 (funcall (gnus-get-function gnus-command-method 'retrieve-group-data-early) |
f2e111723c3a
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110199
diff
changeset
|
354 (nth 1 gnus-command-method) |
f2e111723c3a
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110199
diff
changeset
|
355 infos)) |
f2e111723c3a
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110199
diff
changeset
|
356 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
357 (defun gnus-request-list-newsgroups (gnus-command-method) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
358 "Request the newsgroups file from GNUS-COMMAND-METHOD." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
359 (when (stringp gnus-command-method) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
360 (setq gnus-command-method (gnus-server-to-method gnus-command-method))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
361 (funcall (gnus-get-function gnus-command-method 'request-list-newsgroups) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
362 (nth 1 gnus-command-method))) |
17493 | 363 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
364 (defun gnus-request-newgroups (date gnus-command-method) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
365 "Request all new groups since DATE from GNUS-COMMAND-METHOD." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
366 (when (stringp gnus-command-method) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
367 (setq gnus-command-method (gnus-server-to-method gnus-command-method))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
368 (let ((func (gnus-get-function gnus-command-method 'request-newgroups t))) |
17493 | 369 (when func |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
370 (funcall func date (nth 1 gnus-command-method))))) |
17493 | 371 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
372 (defun gnus-request-regenerate (gnus-command-method) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
373 "Request a data generation from GNUS-COMMAND-METHOD." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
374 (when (stringp gnus-command-method) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
375 (setq gnus-command-method (gnus-server-to-method gnus-command-method))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
376 (funcall (gnus-get-function gnus-command-method 'request-regenerate) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
377 (nth 1 gnus-command-method))) |
17493 | 378 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
379 (defun gnus-request-compact-group (group) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
380 (let* ((method (gnus-find-method-for-group group)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
381 (gnus-command-method method) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
382 (result |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
383 (funcall (gnus-get-function gnus-command-method |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
384 'request-compact-group) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
385 (gnus-group-real-name group) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
386 (nth 1 gnus-command-method) t))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
387 result)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
388 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
389 (defun gnus-request-compact (gnus-command-method) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
390 "Request groups compaction from GNUS-COMMAND-METHOD." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
391 (when (stringp gnus-command-method) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
392 (setq gnus-command-method (gnus-server-to-method gnus-command-method))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
393 (funcall (gnus-get-function gnus-command-method 'request-compact) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
394 (nth 1 gnus-command-method))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
395 |
110422
93e093c035a0
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110410
diff
changeset
|
396 (defun gnus-request-group (group &optional dont-check gnus-command-method info) |
17493 | 397 "Request GROUP. If DONT-CHECK, no information is required." |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
398 (let ((gnus-command-method |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
399 (or gnus-command-method (inline (gnus-find-method-for-group group))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
400 (when (stringp gnus-command-method) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
401 (setq gnus-command-method |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
402 (inline (gnus-server-to-method gnus-command-method)))) |
110199
46ace9f35be1
gnus-int.el (gnus-request-group): Indent.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110189
diff
changeset
|
403 (funcall (inline (gnus-get-function gnus-command-method 'request-group)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
404 (gnus-group-real-name group) (nth 1 gnus-command-method) |
110422
93e093c035a0
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110410
diff
changeset
|
405 dont-check |
93e093c035a0
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110410
diff
changeset
|
406 info))) |
17493 | 407 |
408 (defun gnus-list-active-group (group) | |
409 "Request active information on GROUP." | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
410 (let ((gnus-command-method (gnus-find-method-for-group group)) |
17493 | 411 (func 'list-active-group)) |
412 (when (gnus-check-backend-function func group) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
413 (funcall (gnus-get-function gnus-command-method func) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
414 (gnus-group-real-name group) (nth 1 gnus-command-method))))) |
17493 | 415 |
416 (defun gnus-request-group-description (group) | |
417 "Request a description of GROUP." | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
418 (let ((gnus-command-method (gnus-find-method-for-group group)) |
17493 | 419 (func 'request-group-description)) |
420 (when (gnus-check-backend-function func group) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
421 (funcall (gnus-get-function gnus-command-method func) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
422 (gnus-group-real-name group) (nth 1 gnus-command-method))))) |
17493 | 423 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
424 (defun gnus-request-group-articles (group) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
425 "Request a list of existing articles in GROUP." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
426 (let ((gnus-command-method (gnus-find-method-for-group group)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
427 (func 'request-group-articles)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
428 (when (gnus-check-backend-function func group) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
429 (funcall (gnus-get-function gnus-command-method func) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
430 (gnus-group-real-name group) (nth 1 gnus-command-method))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
431 |
17493 | 432 (defun gnus-close-group (group) |
433 "Request the GROUP be closed." | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
434 (let ((gnus-command-method (inline (gnus-find-method-for-group group)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
435 (funcall (gnus-get-function gnus-command-method 'close-group) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
436 (gnus-group-real-name group) (nth 1 gnus-command-method)))) |
17493 | 437 |
438 (defun gnus-retrieve-headers (articles group &optional fetch-old) | |
439 "Request headers for ARTICLES in GROUP. | |
440 If FETCH-OLD, retrieve all headers (or some subset thereof) in the group." | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
441 (let ((gnus-command-method (gnus-find-method-for-group group))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
442 (cond |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
443 ((and gnus-use-cache (numberp (car articles))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
444 (gnus-cache-retrieve-headers articles group fetch-old)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
445 ((and gnus-agent (gnus-online gnus-command-method) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
446 (gnus-agent-method-p gnus-command-method)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
447 (gnus-agent-retrieve-headers articles group fetch-old)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
448 (t |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
449 (funcall (gnus-get-function gnus-command-method 'retrieve-headers) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
450 articles (gnus-group-real-name group) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
451 (nth 1 gnus-command-method) fetch-old))))) |
17493 | 452 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
453 (defun gnus-retrieve-articles (articles group) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
454 "Request ARTICLES in GROUP." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
455 (let ((gnus-command-method (gnus-find-method-for-group group))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
456 (funcall (gnus-get-function gnus-command-method 'retrieve-articles) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
457 articles (gnus-group-real-name group) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
458 (nth 1 gnus-command-method)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
459 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
460 (defun gnus-retrieve-groups (groups gnus-command-method) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
461 "Request active information on GROUPS from GNUS-COMMAND-METHOD." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
462 (when (stringp gnus-command-method) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
463 (setq gnus-command-method (gnus-server-to-method gnus-command-method))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
464 (funcall (gnus-get-function gnus-command-method 'retrieve-groups) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
465 groups (nth 1 gnus-command-method))) |
17493 | 466 |
467 (defun gnus-request-type (group &optional article) | |
468 "Return the type (`post' or `mail') of GROUP (and ARTICLE)." | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
469 (let ((gnus-command-method (gnus-find-method-for-group group))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
470 (if (not (gnus-check-backend-function |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
471 'request-type (car gnus-command-method))) |
17493 | 472 'unknown |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
473 (funcall (gnus-get-function gnus-command-method 'request-type) |
17493 | 474 (gnus-group-real-name group) article)))) |
475 | |
111986
faa4a1c986c6
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111838
diff
changeset
|
476 (defun gnus-request-update-group-status (group status) |
faa4a1c986c6
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111838
diff
changeset
|
477 "Change the status of a group. |
faa4a1c986c6
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111838
diff
changeset
|
478 Valid statuses include `subscribe' and `unsubscribe'." |
faa4a1c986c6
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111838
diff
changeset
|
479 (let ((gnus-command-method (gnus-find-method-for-group group))) |
faa4a1c986c6
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111838
diff
changeset
|
480 (if (not (gnus-check-backend-function |
faa4a1c986c6
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111838
diff
changeset
|
481 'request-update-group-status (car gnus-command-method))) |
faa4a1c986c6
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111838
diff
changeset
|
482 nil |
faa4a1c986c6
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111838
diff
changeset
|
483 (funcall |
faa4a1c986c6
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111838
diff
changeset
|
484 (gnus-get-function gnus-command-method 'request-update-group-status) |
faa4a1c986c6
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111838
diff
changeset
|
485 (gnus-group-real-name group) status |
faa4a1c986c6
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111838
diff
changeset
|
486 (nth 1 gnus-command-method))))) |
faa4a1c986c6
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111838
diff
changeset
|
487 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
488 (defun gnus-request-set-mark (group action) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
489 "Set marks on articles in the back end." |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
490 (let ((gnus-command-method (gnus-find-method-for-group group))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
491 (if (not (gnus-check-backend-function |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
492 'request-set-mark (car gnus-command-method))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
493 action |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
494 (funcall (gnus-get-function gnus-command-method 'request-set-mark) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
495 (gnus-group-real-name group) action |
110799
d2b45bb936b6
gnus-int.el, gnus-util.el: Gnus hooks for the mark get/set operations.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110661
diff
changeset
|
496 (nth 1 gnus-command-method)) |
d2b45bb936b6
gnus-int.el, gnus-util.el: Gnus hooks for the mark get/set operations.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110661
diff
changeset
|
497 (gnus-run-hook-with-args gnus-after-set-mark-hook group action)))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
498 |
17493 | 499 (defun gnus-request-update-mark (group article mark) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
500 "Allow the back end to change the mark the user tries to put on an article." |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
501 (let ((gnus-command-method (gnus-find-method-for-group group))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
502 (if (not (gnus-check-backend-function |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
503 'request-update-mark (car gnus-command-method))) |
17493 | 504 mark |
110799
d2b45bb936b6
gnus-int.el, gnus-util.el: Gnus hooks for the mark get/set operations.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110661
diff
changeset
|
505 (gnus-run-hook-with-args gnus-before-update-mark-hook group article mark) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
506 (funcall (gnus-get-function gnus-command-method 'request-update-mark) |
17493 | 507 (gnus-group-real-name group) article mark)))) |
508 | |
509 (defun gnus-request-article (article group &optional buffer) | |
510 "Request the ARTICLE in GROUP. | |
511 ARTICLE can either be an article number or an article Message-ID. | |
512 If BUFFER, insert the article in that group." | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
513 (let ((gnus-command-method (gnus-find-method-for-group group))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
514 (funcall (gnus-get-function gnus-command-method 'request-article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
515 article (gnus-group-real-name group) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
516 (nth 1 gnus-command-method) buffer))) |
17493 | 517 |
111838
de6f9af48bfa
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111830
diff
changeset
|
518 (defun gnus-request-thread (header) |
de6f9af48bfa
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111830
diff
changeset
|
519 "Request the headers in the thread containing the article specified by HEADER." |
110999
9330a5183ae6
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110915
diff
changeset
|
520 (let ((gnus-command-method (gnus-find-method-for-group gnus-newsgroup-name))) |
9330a5183ae6
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110915
diff
changeset
|
521 (funcall (gnus-get-function gnus-command-method 'request-thread) |
111838
de6f9af48bfa
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111830
diff
changeset
|
522 header))) |
110999
9330a5183ae6
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110915
diff
changeset
|
523 |
111430
b75e6634a171
gnus-int.el, nnimap.el, nnir.el: More improvements to thread-referral.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111240
diff
changeset
|
524 (defun gnus-warp-to-article () |
b75e6634a171
gnus-int.el, nnimap.el, nnir.el: More improvements to thread-referral.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111240
diff
changeset
|
525 "Warps from an article in a virtual group to the article in its |
b75e6634a171
gnus-int.el, nnimap.el, nnir.el: More improvements to thread-referral.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111240
diff
changeset
|
526 real group. Does nothing on a real group." |
b75e6634a171
gnus-int.el, nnimap.el, nnir.el: More improvements to thread-referral.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111240
diff
changeset
|
527 (interactive) |
b75e6634a171
gnus-int.el, nnimap.el, nnir.el: More improvements to thread-referral.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111240
diff
changeset
|
528 (let ((gnus-command-method |
b75e6634a171
gnus-int.el, nnimap.el, nnir.el: More improvements to thread-referral.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111240
diff
changeset
|
529 (gnus-find-method-for-group gnus-newsgroup-name))) |
b75e6634a171
gnus-int.el, nnimap.el, nnir.el: More improvements to thread-referral.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111240
diff
changeset
|
530 (when (gnus-check-backend-function |
b75e6634a171
gnus-int.el, nnimap.el, nnir.el: More improvements to thread-referral.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111240
diff
changeset
|
531 'warp-to-article (car gnus-command-method)) |
b75e6634a171
gnus-int.el, nnimap.el, nnir.el: More improvements to thread-referral.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111240
diff
changeset
|
532 (funcall (gnus-get-function gnus-command-method 'warp-to-article))))) |
b75e6634a171
gnus-int.el, nnimap.el, nnir.el: More improvements to thread-referral.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111240
diff
changeset
|
533 |
17493 | 534 (defun gnus-request-head (article group) |
535 "Request the head of ARTICLE in GROUP." | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
536 (let* ((gnus-command-method (gnus-find-method-for-group group)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
537 (head (gnus-get-function gnus-command-method 'request-head t)) |
17493 | 538 res clean-up) |
539 (cond | |
540 ;; Check the cache. | |
541 ((and gnus-use-cache | |
542 (numberp article) | |
543 (gnus-cache-request-article article group)) | |
544 (setq res (cons group article) | |
545 clean-up t)) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
546 ;; Check the agent cache. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
547 ((gnus-agent-request-article article group) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
548 (setq res (cons group article) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
549 clean-up t)) |
17493 | 550 ;; Use `head' function. |
551 ((fboundp head) | |
552 (setq res (funcall head article (gnus-group-real-name group) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
553 (nth 1 gnus-command-method)))) |
17493 | 554 ;; Use `article' function. |
555 (t | |
556 (setq res (gnus-request-article article group) | |
557 clean-up t))) | |
558 (when clean-up | |
110410
f2e111723c3a
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110199
diff
changeset
|
559 (with-current-buffer nntp-server-buffer |
17493 | 560 (goto-char (point-min)) |
561 (when (search-forward "\n\n" nil t) | |
562 (delete-region (1- (point)) (point-max))) | |
563 (nnheader-fold-continuation-lines))) | |
564 res)) | |
565 | |
566 (defun gnus-request-body (article group) | |
567 "Request the body of ARTICLE in GROUP." | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
568 (let* ((gnus-command-method (gnus-find-method-for-group group)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
569 (head (gnus-get-function gnus-command-method 'request-body t)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
570 res clean-up) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
571 (cond |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
572 ;; Check the cache. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
573 ((and gnus-use-cache |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
574 (numberp article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
575 (gnus-cache-request-article article group)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
576 (setq res (cons group article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
577 clean-up t)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
578 ;; Check the agent cache. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
579 ((gnus-agent-request-article article group) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
580 (setq res (cons group article) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
581 clean-up t)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
582 ;; Use `head' function. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
583 ((fboundp head) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
584 (setq res (funcall head article (gnus-group-real-name group) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
585 (nth 1 gnus-command-method)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
586 ;; Use `article' function. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
587 (t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
588 (setq res (gnus-request-article article group) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
589 clean-up t))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
590 (when clean-up |
110410
f2e111723c3a
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110199
diff
changeset
|
591 (with-current-buffer nntp-server-buffer |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
592 (goto-char (point-min)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
593 (when (search-forward "\n\n" nil t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
594 (delete-region (point-min) (1- (point)))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
595 res)) |
17493 | 596 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
597 (defun gnus-request-post (gnus-command-method) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
598 "Post the current buffer using GNUS-COMMAND-METHOD." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
599 (when (stringp gnus-command-method) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
600 (setq gnus-command-method (gnus-server-to-method gnus-command-method))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
601 (funcall (gnus-get-function gnus-command-method 'request-post) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
602 (nth 1 gnus-command-method))) |
17493 | 603 |
110465
b7b7e970d807
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110433
diff
changeset
|
604 (defun gnus-request-expunge-group (group gnus-command-method) |
b7b7e970d807
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110433
diff
changeset
|
605 "Expunge GROUP, which is removing articles that have been marked as deleted." |
b7b7e970d807
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110433
diff
changeset
|
606 (when (stringp gnus-command-method) |
b7b7e970d807
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110433
diff
changeset
|
607 (setq gnus-command-method (gnus-server-to-method gnus-command-method))) |
b7b7e970d807
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110433
diff
changeset
|
608 (funcall (gnus-get-function gnus-command-method 'request-expunge-group) |
b7b7e970d807
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110433
diff
changeset
|
609 (gnus-group-real-name group) |
b7b7e970d807
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110433
diff
changeset
|
610 (nth 1 gnus-command-method))) |
b7b7e970d807
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110433
diff
changeset
|
611 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
612 (defun gnus-request-scan (group gnus-command-method) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
613 "Request a SCAN being performed in GROUP from GNUS-COMMAND-METHOD. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
614 If GROUP is nil, all groups on GNUS-COMMAND-METHOD are scanned." |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
615 (let ((gnus-command-method |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
616 (if group (gnus-find-method-for-group group) gnus-command-method)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
617 (gnus-inhibit-demon t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
618 (mail-source-plugged gnus-plugged)) |
110189
821c596efa5f
Rewrite the Gnus group activation method to be more efficient; nnmh.el (nnmh-request-list-1): Fix up the recursion behavior; Add more changes related to the new methodology for requesting backend data.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
619 (when (or gnus-plugged |
821c596efa5f
Rewrite the Gnus group activation method to be more efficient; nnmh.el (nnmh-request-list-1): Fix up the recursion behavior; Add more changes related to the new methodology for requesting backend data.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
620 (not (gnus-agent-method-p gnus-command-method))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
621 (setq gnus-internal-registry-spool-current-method gnus-command-method) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
622 (funcall (gnus-get-function gnus-command-method 'request-scan) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
623 (and group (gnus-group-real-name group)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
624 (nth 1 gnus-command-method))))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
625 |
110516
4d2f8b81bb01
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110486
diff
changeset
|
626 (defun gnus-request-update-info (info gnus-command-method) |
4d2f8b81bb01
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110486
diff
changeset
|
627 (when (gnus-check-backend-function |
4d2f8b81bb01
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110486
diff
changeset
|
628 'request-update-info (car gnus-command-method)) |
4d2f8b81bb01
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110486
diff
changeset
|
629 (when (stringp gnus-command-method) |
4d2f8b81bb01
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110486
diff
changeset
|
630 (setq gnus-command-method (gnus-server-to-method gnus-command-method))) |
4d2f8b81bb01
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110486
diff
changeset
|
631 (funcall (gnus-get-function gnus-command-method 'request-update-info) |
4d2f8b81bb01
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110486
diff
changeset
|
632 (gnus-group-real-name (gnus-info-group info)) info |
4d2f8b81bb01
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110486
diff
changeset
|
633 (nth 1 gnus-command-method)))) |
4d2f8b81bb01
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110486
diff
changeset
|
634 |
4d2f8b81bb01
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110486
diff
changeset
|
635 (defsubst gnus-request-marks (info gnus-command-method) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
636 "Request that GNUS-COMMAND-METHOD update INFO." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
637 (when (stringp gnus-command-method) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
638 (setq gnus-command-method (gnus-server-to-method gnus-command-method))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
639 (when (gnus-check-backend-function |
110516
4d2f8b81bb01
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110486
diff
changeset
|
640 'request-marks (car gnus-command-method)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
641 (let ((group (gnus-info-group info))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
642 (and (funcall (gnus-get-function gnus-command-method |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
643 'request-update-info) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
644 (gnus-group-real-name group) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
645 info (nth 1 gnus-command-method)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
646 ;; If the minimum article number is greater than 1, then all |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
647 ;; smaller article numbers are known not to exist; we'll |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
648 ;; artificially add those to the 'read range. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
649 (let* ((active (gnus-active group)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
650 (min (car active))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
651 (when (> min 1) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
652 (let* ((range (if (= min 2) 1 (cons 1 (1- min)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
653 (read (gnus-info-read info)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
654 (new-read (gnus-range-add read (list range)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
655 (gnus-info-set-read info new-read))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
656 info))))) |
17493 | 657 |
658 (defun gnus-request-expire-articles (articles group &optional force) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
659 (let* ((gnus-command-method (gnus-find-method-for-group group)) |
110486
1ad1adb298a3
Merge Changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110465
diff
changeset
|
660 (gnus-inhibit-demon t) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
661 (not-deleted |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
662 (funcall |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
663 (gnus-get-function gnus-command-method 'request-expire-articles) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
664 articles (gnus-group-real-name group) (nth 1 gnus-command-method) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
665 force))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
666 (when (and gnus-agent |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
667 (gnus-agent-method-p gnus-command-method)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
668 (let ((expired-articles (gnus-sorted-difference articles not-deleted))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
669 (when expired-articles |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
670 (gnus-agent-expire expired-articles group 'force)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
671 not-deleted)) |
17493 | 672 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
673 (defun gnus-request-move-article (article group server accept-function |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
674 &optional last move-is-internal) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
675 (let* ((gnus-command-method (gnus-find-method-for-group group)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
676 (result (funcall (gnus-get-function gnus-command-method |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
677 'request-move-article) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
678 article (gnus-group-real-name group) |
111168
d1079095427d
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110999
diff
changeset
|
679 (nth 1 gnus-command-method) accept-function |
d1079095427d
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110999
diff
changeset
|
680 last move-is-internal))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
681 (when (and result gnus-agent |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
682 (gnus-agent-method-p gnus-command-method)) |
57617
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57153
diff
changeset
|
683 (gnus-agent-unfetch-articles group (list article))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
684 result)) |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
57617
diff
changeset
|
685 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
686 (defun gnus-request-accept-article (group &optional gnus-command-method last |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
687 no-encode) |
17493 | 688 ;; Make sure there's a newline at the end of the article. |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
689 (when (stringp gnus-command-method) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
690 (setq gnus-command-method (gnus-server-to-method gnus-command-method))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
691 (when (and (not gnus-command-method) |
17493 | 692 (stringp group)) |
57617
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57153
diff
changeset
|
693 (setq gnus-command-method (or (gnus-find-method-for-group group) |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57153
diff
changeset
|
694 (gnus-group-name-to-method group)))) |
17493 | 695 (goto-char (point-max)) |
696 (unless (bolp) | |
697 (insert "\n")) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
698 (unless no-encode |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
699 (let ((message-options message-options)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
700 (message-options-set-recipient) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
701 (save-restriction |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
702 (message-narrow-to-head) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
703 (let ((mail-parse-charset message-default-charset)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
704 (mail-encode-encoded-word-buffer))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
705 (message-encode-message-body))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
706 (let ((gnus-command-method (or gnus-command-method |
57617
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57153
diff
changeset
|
707 (gnus-find-method-for-group group))) |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
57617
diff
changeset
|
708 (result |
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
57617
diff
changeset
|
709 (funcall |
57617
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57153
diff
changeset
|
710 (gnus-get-function gnus-command-method 'request-accept-article) |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57153
diff
changeset
|
711 (if (stringp group) (gnus-group-real-name group) group) |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57153
diff
changeset
|
712 (cadr gnus-command-method) |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57153
diff
changeset
|
713 last))) |
112193
700b890dcfb5
proto-stream.el (open-protocol-stream): Protect against the low-level transport functions returning nil.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111986
diff
changeset
|
714 (when (and gnus-agent |
700b890dcfb5
proto-stream.el (open-protocol-stream): Protect against the low-level transport functions returning nil.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111986
diff
changeset
|
715 (gnus-agent-method-p gnus-command-method) |
700b890dcfb5
proto-stream.el (open-protocol-stream): Protect against the low-level transport functions returning nil.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111986
diff
changeset
|
716 (cdr result)) |
57617
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57153
diff
changeset
|
717 (gnus-agent-regenerate-group group (list (cdr result)))) |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57153
diff
changeset
|
718 result)) |
17493 | 719 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
720 (defun gnus-request-replace-article (article group buffer &optional no-encode) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
721 (unless no-encode |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
722 (let ((message-options message-options)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
723 (message-options-set-recipient) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
724 (save-restriction |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
725 (message-narrow-to-head) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
726 (let ((mail-parse-charset message-default-charset)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
727 (mail-encode-encoded-word-buffer))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
728 (message-encode-message-body))) |
57617
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57153
diff
changeset
|
729 (let* ((func (car (gnus-group-name-to-method group))) |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57153
diff
changeset
|
730 (result (funcall (intern (format "%s-request-replace-article" func)) |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57153
diff
changeset
|
731 article (gnus-group-real-name group) buffer))) |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57153
diff
changeset
|
732 (when (and gnus-agent (gnus-agent-method-p gnus-command-method)) |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57153
diff
changeset
|
733 (gnus-agent-regenerate-group group (list article))) |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57153
diff
changeset
|
734 result)) |
17493 | 735 |
736 (defun gnus-request-associate-buffer (group) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
737 (let ((gnus-command-method (gnus-find-method-for-group group))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
738 (funcall (gnus-get-function gnus-command-method 'request-associate-buffer) |
17493 | 739 (gnus-group-real-name group)))) |
740 | |
741 (defun gnus-request-restore-buffer (article group) | |
742 "Request a new buffer restored to the state of ARTICLE." | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
743 (let ((gnus-command-method (gnus-find-method-for-group group))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
744 (funcall (gnus-get-function gnus-command-method 'request-restore-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
745 article (gnus-group-real-name group) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
746 (nth 1 gnus-command-method)))) |
17493 | 747 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
748 (defun gnus-request-create-group (group &optional gnus-command-method args) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
749 (when (stringp gnus-command-method) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
750 (setq gnus-command-method (gnus-server-to-method gnus-command-method))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
751 (let ((gnus-command-method |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
752 (or gnus-command-method (gnus-find-method-for-group group)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
753 (funcall (gnus-get-function gnus-command-method 'request-create-group) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
754 (gnus-group-real-name group) (nth 1 gnus-command-method) args))) |
17493 | 755 |
756 (defun gnus-request-delete-group (group &optional force) | |
57617
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57153
diff
changeset
|
757 (let* ((gnus-command-method (gnus-find-method-for-group group)) |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57153
diff
changeset
|
758 (result |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57153
diff
changeset
|
759 (funcall (gnus-get-function gnus-command-method 'request-delete-group) |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57153
diff
changeset
|
760 (gnus-group-real-name group) force (nth 1 gnus-command-method)))) |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57153
diff
changeset
|
761 (when result |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57153
diff
changeset
|
762 (gnus-cache-delete-group group) |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57153
diff
changeset
|
763 (gnus-agent-delete-group group)) |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57153
diff
changeset
|
764 result)) |
17493 | 765 |
766 (defun gnus-request-rename-group (group new-name) | |
57617
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57153
diff
changeset
|
767 (let* ((gnus-command-method (gnus-find-method-for-group group)) |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57153
diff
changeset
|
768 (result |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57153
diff
changeset
|
769 (funcall (gnus-get-function gnus-command-method 'request-rename-group) |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57153
diff
changeset
|
770 (gnus-group-real-name group) |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57153
diff
changeset
|
771 (gnus-group-real-name new-name) (nth 1 gnus-command-method)))) |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57153
diff
changeset
|
772 (when result |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57153
diff
changeset
|
773 (gnus-cache-rename-group group new-name) |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57153
diff
changeset
|
774 (gnus-agent-rename-group group new-name)) |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57153
diff
changeset
|
775 result)) |
17493 | 776 |
777 (defun gnus-close-backends () | |
778 ;; Send a close request to all backends that support such a request. | |
779 (let ((methods gnus-valid-select-methods) | |
780 (gnus-inhibit-demon t) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
781 func gnus-command-method) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
782 (while (setq gnus-command-method (pop methods)) |
17493 | 783 (when (fboundp (setq func (intern |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
784 (concat (car gnus-command-method) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
785 "-request-close")))) |
17493 | 786 (funcall func))))) |
787 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
788 (defun gnus-asynchronous-p (gnus-command-method) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
789 (let ((func (gnus-get-function gnus-command-method 'asynchronous-p t))) |
17493 | 790 (when (fboundp func) |
791 (funcall func)))) | |
792 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
793 (defun gnus-remove-denial (gnus-command-method) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
794 (when (stringp gnus-command-method) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
795 (setq gnus-command-method (gnus-server-to-method gnus-command-method))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
796 (let* ((elem (assoc gnus-command-method gnus-opened-servers)) |
17493 | 797 (status (cadr elem))) |
798 ;; If this hasn't been opened before, we add it to the list. | |
799 (when (eq status 'denied) | |
800 ;; Set the status of this server. | |
801 (setcar (cdr elem) 'closed)))) | |
802 | |
803 (provide 'gnus-int) | |
804 | |
805 ;;; gnus-int.el ends here |