1 ;;; gnus-int.el --- backend interface functions for Gnus
2 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
3 ;; Free Software Foundation, Inc.
5 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
6 ;; MORIOKA Tomohiko <morioka@jaist.ac.jp>
9 ;; This file is part of GNU Emacs.
11 ;; GNU Emacs is free software; you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation; either version 2, or (at your option)
16 ;; GNU Emacs is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;; GNU General Public License for more details.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 ;; Boston, MA 02111-1307, USA.
30 (eval-when-compile (require 'cl))
36 (autoload 'gnus-agent-expire "gnus-agent")
37 (autoload 'gnus-agent-regenerate-group "gnus-agent")
38 (autoload 'gnus-agent-read-servers-validate-native "gnus-agent")
40 (defcustom gnus-open-server-hook nil
41 "Hook called just before opening connection to the news server."
45 (defcustom gnus-server-unopen-status nil
46 "The default status if the server is not able to open.
47 If the server is covered by Gnus agent, the possible values are
48 `denied', set the server denied; `offline', set the server offline;
49 nil, ask user. If the server is not covered by Gnus agent, set the
53 :type '(choice (const :tag "Ask" nil)
54 (const :tag "Deny server" denied)
55 (const :tag "Unplug Agent" offline)))
57 (defcustom gnus-servers-that-use-local-marks '(nntp)
58 "A list of backends that store marks locally. This means that
59 the backend is used to set its marks even when unplugged."
61 :type '(repeat symbol))
63 (defvar gnus-internal-registry-spool-current-method nil
64 "The current method, for the registry.")
67 ;;; Server Communication
70 (defun gnus-start-news-server (&optional confirm)
71 "Open a method for getting news.
72 If CONFIRM is non-nil, the user will be asked for an NNTP server."
74 (if gnus-current-select-method
75 ;; Stream is already opened.
78 (unless gnus-nntp-service
79 (setq gnus-nntp-server nil))
81 ;; Read server name with completion.
82 (setq gnus-nntp-server
83 (completing-read "NNTP server: "
85 (cons (list gnus-nntp-server)
86 gnus-secondary-servers))
87 nil nil gnus-nntp-server)))
89 (when (and gnus-nntp-server
90 (stringp gnus-nntp-server)
91 (not (string= gnus-nntp-server "")))
92 (setq gnus-select-method
93 (cond ((or (string= gnus-nntp-server "")
94 (string= gnus-nntp-server "::"))
95 (list 'nnspool (system-name)))
96 ((string-match "^:" gnus-nntp-server)
97 (list 'nnmh gnus-nntp-server
99 (file-name-as-directory
101 (substring gnus-nntp-server 1) "~/")))
102 (list 'nnmh-get-new-mail nil)))
104 (list 'nntp gnus-nntp-server)))))
106 (setq how (car gnus-select-method))
110 (gnus-message 5 "Looking up local news spool..."))
113 (gnus-message 5 "Looking up mh spool..."))
116 (setq gnus-current-select-method gnus-select-method)
117 (gnus-run-hooks 'gnus-open-server-hook)
119 ;; Partially validate agent covered methods now that the
120 ;; gnus-select-method is known.
123 ;; NOTE: This is here for one purpose only. By validating
124 ;; the current select method, it converts the old 5.10.3,
125 ;; and earlier, format to the current format. That enables
126 ;; the agent code within gnus-open-server to function
128 (gnus-agent-read-servers-validate-native gnus-select-method))
131 ;; gnus-open-server-hook might have opened it
132 (gnus-server-opened gnus-select-method)
133 (gnus-open-server gnus-select-method)
137 "%s (%s) open error: '%s'. Continue? "
138 (car gnus-select-method) (cadr gnus-select-method)
139 (gnus-status-message gnus-select-method)))
140 (gnus-error 1 "Couldn't open server on %s"
141 (nth 1 gnus-select-method))))))
143 (defun gnus-check-group (group)
144 "Try to make sure that the server where GROUP exists is alive."
145 (let ((method (gnus-find-method-for-group group)))
146 (or (gnus-server-opened method)
147 (gnus-open-server method))))
149 (defun gnus-check-server (&optional method silent)
150 "Check whether the connection to METHOD is down.
151 If METHOD is nil, use `gnus-select-method'.
152 If it is down, start it up (again)."
153 (let ((method (or method gnus-select-method))
155 ;; Transform virtual server names into select methods.
156 (when (stringp method)
157 (setq method (gnus-server-to-method method)))
158 (if (gnus-server-opened method)
159 ;; The stream is already opened.
163 (gnus-message 5 "Opening %s server%s..." (car method)
164 (if (equal (nth 1 method) "") ""
165 (format " on %s" (nth 1 method)))))
166 (gnus-run-hooks 'gnus-open-server-hook)
169 (setq result (gnus-open-server method))
170 (quit (message "Quit gnus-check-server")
173 (gnus-message 5 "Opening %s server%s...%s" (car method)
174 (if (equal (nth 1 method) "") ""
175 (format " on %s" (nth 1 method)))
176 (if result "done" "failed")))))))
178 (defun gnus-get-function (method function &optional noerror)
179 "Return a function symbol based on METHOD and FUNCTION."
180 ;; Translate server names into methods.
182 (error "Attempted use of a nil select method"))
183 (when (stringp method)
184 (setq method (gnus-server-to-method method)))
185 ;; Check cache of constructed names.
186 (let* ((method-sym (if gnus-agent
187 (inline (gnus-agent-get-function method))
189 (method-fns (get method-sym 'gnus-method-functions))
190 (func (let ((method-fnlist-elt (assq function method-fns)))
191 (unless method-fnlist-elt
192 (setq method-fnlist-elt
194 (intern (format "%s-%s" method-sym function))))
195 (put method-sym 'gnus-method-functions
196 (cons method-fnlist-elt method-fns)))
197 (cdr method-fnlist-elt))))
198 ;; Maybe complain if there is no function.
199 (unless (fboundp func)
201 (error "Trying to require a method that doesn't exist"))
202 (require (car method))
203 (when (not (fboundp func))
206 (error "No such function: %s" func))))
211 ;;; Interface functions to the backends.
214 (defun gnus-open-server (gnus-command-method)
215 "Open a connection to GNUS-COMMAND-METHOD."
216 (when (stringp gnus-command-method)
217 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
218 (let ((elem (assoc gnus-command-method gnus-opened-servers)))
219 ;; If this method was previously denied, we just return nil.
220 (if (eq (nth 1 elem) 'denied)
222 (gnus-message 1 "Denied server")
225 (let* ((open-server-function (gnus-get-function gnus-command-method 'open-server))
228 (funcall open-server-function
229 (nth 1 gnus-command-method)
230 (nthcdr 2 gnus-command-method))
232 (gnus-message 1 (format
233 "Unable to open server due to: %s"
234 (error-message-string err)))
237 (gnus-message 1 "Quit trying to open server")
240 ;; If this hasn't been opened before, we add it to the list.
242 (setq elem (list gnus-command-method nil)
243 gnus-opened-servers (cons elem gnus-opened-servers)))
244 ;; Set the status of this server.
247 (if (eq open-server-function #'nnagent-open-server)
248 ;; The agent's backend has a "special" status
252 (gnus-agent-method-p gnus-command-method))
253 (cond (gnus-server-unopen-status
254 ;; Set the server's status to the unopen
255 ;; status. If that status is offline,
256 ;; recurse to open the agent's backend.
257 (setq open-offline (eq gnus-server-unopen-status 'offline))
258 gnus-server-unopen-status)
260 (format "Unable to open %s:%s, go offline? "
261 (car gnus-command-method)
262 (cadr gnus-command-method)))
263 (setq open-offline t)
266 ;; This agentized server was still denied
269 ;; This unagentized server must be denied
272 ;; NOTE: I MUST set the server's status to offline before this
273 ;; recursive call as this status will drive the
274 ;; gnus-get-function (called above) to return the agent's
277 ;; Recursively open this offline server to perform the
278 ;; open-server function of the agent's backend.
279 (let ((gnus-server-unopen-status 'denied))
280 ;; Bind gnus-server-unopen-status to avoid recursively
281 ;; prompting with "go offline?". This is only a concern
282 ;; when the agent's backend fails to open the server.
283 (gnus-open-server gnus-command-method))
286 (defun gnus-close-server (gnus-command-method)
287 "Close the connection to GNUS-COMMAND-METHOD."
288 (when (stringp gnus-command-method)
289 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
290 (funcall (gnus-get-function gnus-command-method 'close-server)
291 (nth 1 gnus-command-method)))
293 (defun gnus-request-list (gnus-command-method)
294 "Request the active file from GNUS-COMMAND-METHOD."
295 (when (stringp gnus-command-method)
296 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
297 (funcall (gnus-get-function gnus-command-method 'request-list)
298 (nth 1 gnus-command-method)))
300 (defun gnus-request-list-newsgroups (gnus-command-method)
301 "Request the newsgroups file from GNUS-COMMAND-METHOD."
302 (when (stringp gnus-command-method)
303 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
304 (funcall (gnus-get-function gnus-command-method 'request-list-newsgroups)
305 (nth 1 gnus-command-method)))
307 (defun gnus-request-newgroups (date gnus-command-method)
308 "Request all new groups since DATE from GNUS-COMMAND-METHOD."
309 (when (stringp gnus-command-method)
310 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
311 (let ((func (gnus-get-function gnus-command-method 'request-newgroups t)))
313 (funcall func date (nth 1 gnus-command-method)))))
315 (defun gnus-server-opened (gnus-command-method)
316 "Check whether a connection to GNUS-COMMAND-METHOD has been opened."
317 (unless (eq (gnus-server-status gnus-command-method)
319 (when (stringp gnus-command-method)
320 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
321 (funcall (inline (gnus-get-function gnus-command-method 'server-opened))
322 (nth 1 gnus-command-method))))
324 (defun gnus-status-message (gnus-command-method)
325 "Return the status message from GNUS-COMMAND-METHOD.
326 If GNUS-COMMAND-METHOD is a string, it is interpreted as a group
327 name. The method this group uses will be queried."
328 (let ((gnus-command-method
329 (if (stringp gnus-command-method)
330 (gnus-find-method-for-group gnus-command-method)
331 gnus-command-method)))
332 (funcall (gnus-get-function gnus-command-method 'status-message)
333 (nth 1 gnus-command-method))))
335 (defun gnus-request-regenerate (gnus-command-method)
336 "Request a data generation from GNUS-COMMAND-METHOD."
337 (when (stringp gnus-command-method)
338 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
339 (funcall (gnus-get-function gnus-command-method 'request-regenerate)
340 (nth 1 gnus-command-method)))
342 (defun gnus-request-group (group &optional dont-check gnus-command-method)
343 "Request GROUP. If DONT-CHECK, no information is required."
344 (let ((gnus-command-method
345 (or gnus-command-method (inline (gnus-find-method-for-group group)))))
346 (when (stringp gnus-command-method)
347 (setq gnus-command-method
348 (inline (gnus-server-to-method gnus-command-method))))
349 (funcall (inline (gnus-get-function gnus-command-method 'request-group))
350 (gnus-group-real-name group) (nth 1 gnus-command-method)
353 (defun gnus-list-active-group (group)
354 "Request active information on GROUP."
355 (let ((gnus-command-method (gnus-find-method-for-group group))
356 (func 'list-active-group))
357 (when (gnus-check-backend-function func group)
358 (funcall (gnus-get-function gnus-command-method func)
359 (gnus-group-real-name group) (nth 1 gnus-command-method)))))
361 (defun gnus-request-group-description (group)
362 "Request a description of GROUP."
363 (let ((gnus-command-method (gnus-find-method-for-group group))
364 (func 'request-group-description))
365 (when (gnus-check-backend-function func group)
366 (funcall (gnus-get-function gnus-command-method func)
367 (gnus-group-real-name group) (nth 1 gnus-command-method)))))
369 (defun gnus-request-group-articles (group)
370 "Request a list of existing articles in GROUP."
371 (let ((gnus-command-method (gnus-find-method-for-group group))
372 (func 'request-group-articles))
373 (when (gnus-check-backend-function func group)
374 (funcall (gnus-get-function gnus-command-method func)
375 (gnus-group-real-name group) (nth 1 gnus-command-method)))))
377 (defun gnus-close-group (group)
378 "Request the GROUP be closed."
379 (let ((gnus-command-method (inline (gnus-find-method-for-group group))))
380 (funcall (gnus-get-function gnus-command-method 'close-group)
381 (gnus-group-real-name group) (nth 1 gnus-command-method))))
383 (defun gnus-retrieve-headers (articles group &optional fetch-old)
384 "Request headers for ARTICLES in GROUP.
385 If FETCH-OLD, retrieve all headers (or some subset thereof) in the group."
386 (let ((gnus-command-method (gnus-find-method-for-group group)))
388 ((and gnus-use-cache (numberp (car articles)))
389 (gnus-cache-retrieve-headers articles group fetch-old))
390 ((and gnus-agent (gnus-online gnus-command-method)
391 (gnus-agent-method-p gnus-command-method))
392 (gnus-agent-retrieve-headers articles group fetch-old))
394 (funcall (gnus-get-function gnus-command-method 'retrieve-headers)
395 articles (gnus-group-real-name group)
396 (nth 1 gnus-command-method) fetch-old)))))
398 (defun gnus-retrieve-articles (articles group)
399 "Request ARTICLES in GROUP."
400 (let ((gnus-command-method (gnus-find-method-for-group group)))
401 (funcall (gnus-get-function gnus-command-method 'retrieve-articles)
402 articles (gnus-group-real-name group)
403 (nth 1 gnus-command-method))))
405 (defun gnus-retrieve-groups (groups gnus-command-method)
406 "Request active information on GROUPS from GNUS-COMMAND-METHOD."
407 (when (stringp gnus-command-method)
408 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
409 (funcall (gnus-get-function gnus-command-method 'retrieve-groups)
410 groups (nth 1 gnus-command-method)))
412 (defun gnus-request-type (group &optional article)
413 "Return the type (`post' or `mail') of GROUP (and ARTICLE)."
414 (let ((gnus-command-method (gnus-find-method-for-group group)))
415 (if (not (gnus-check-backend-function
416 'request-type (car gnus-command-method)))
418 (funcall (gnus-get-function gnus-command-method 'request-type)
419 (gnus-group-real-name group) article))))
421 (defun gnus-request-set-mark (group action)
422 "Set marks on articles in the back end."
423 (let* ((gnus-command-method (gnus-find-method-for-group group))
424 (gnus-plugged (or gnus-plugged
425 (member (car gnus-command-method)
426 gnus-servers-that-use-local-marks))))
427 (if (not (gnus-check-backend-function
428 'request-set-mark (car gnus-command-method)))
430 (funcall (gnus-get-function gnus-command-method 'request-set-mark)
431 (gnus-group-real-name group) action
432 (nth 1 gnus-command-method)))))
434 (defun gnus-request-update-mark (group article mark)
435 "Allow the back end to change the mark the user tries to put on an article."
436 (let* ((gnus-command-method (gnus-find-method-for-group group))
437 (gnus-plugged (or gnus-plugged
438 (member (car gnus-command-method)
439 gnus-servers-that-use-local-marks))))
440 (if (not (gnus-check-backend-function
441 'request-update-mark (car gnus-command-method)))
443 (funcall (gnus-get-function gnus-command-method 'request-update-mark)
444 (gnus-group-real-name group) article mark))))
446 (defun gnus-request-article (article group &optional buffer)
447 "Request the ARTICLE in GROUP.
448 ARTICLE can either be an article number or an article Message-ID.
449 If BUFFER, insert the article in that group."
450 (let ((gnus-command-method (gnus-find-method-for-group group)))
451 (funcall (gnus-get-function gnus-command-method 'request-article)
452 article (gnus-group-real-name group)
453 (nth 1 gnus-command-method) buffer)))
455 (defun gnus-request-head (article group)
456 "Request the head of ARTICLE in GROUP."
457 (let* ((gnus-command-method (gnus-find-method-for-group group))
458 (head (gnus-get-function gnus-command-method 'request-head t))
464 (gnus-cache-request-article article group))
465 (setq res (cons group article)
467 ;; Check the agent cache.
468 ((gnus-agent-request-article article group)
469 (setq res (cons group article)
471 ;; Use `head' function.
473 (setq res (funcall head article (gnus-group-real-name group)
474 (nth 1 gnus-command-method))))
475 ;; Use `article' function.
477 (setq res (gnus-request-article article group)
481 (set-buffer nntp-server-buffer)
482 (goto-char (point-min))
483 (when (search-forward "\n\n" nil t)
484 (delete-region (1- (point)) (point-max)))
485 (nnheader-fold-continuation-lines)))
488 (defun gnus-request-body (article group)
489 "Request the body of ARTICLE in GROUP."
490 (let* ((gnus-command-method (gnus-find-method-for-group group))
491 (head (gnus-get-function gnus-command-method 'request-body t))
497 (gnus-cache-request-article article group))
498 (setq res (cons group article)
500 ;; Check the agent cache.
501 ((gnus-agent-request-article article group)
502 (setq res (cons group article)
504 ;; Use `head' function.
506 (setq res (funcall head article (gnus-group-real-name group)
507 (nth 1 gnus-command-method))))
508 ;; Use `article' function.
510 (setq res (gnus-request-article article group)
514 (set-buffer nntp-server-buffer)
515 (goto-char (point-min))
516 (when (search-forward "\n\n" nil t)
517 (delete-region (point-min) (1- (point))))))
520 (defun gnus-request-post (gnus-command-method)
521 "Post the current buffer using GNUS-COMMAND-METHOD."
522 (when (stringp gnus-command-method)
523 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
524 (funcall (gnus-get-function gnus-command-method 'request-post)
525 (nth 1 gnus-command-method)))
527 (defun gnus-request-scan (group gnus-command-method)
528 "Request a SCAN being performed in GROUP from GNUS-COMMAND-METHOD.
529 If GROUP is nil, all groups on GNUS-COMMAND-METHOD are scanned."
530 (let ((gnus-command-method
531 (if group (gnus-find-method-for-group group) gnus-command-method))
532 (gnus-inhibit-demon t)
533 (mail-source-plugged gnus-plugged))
534 (when (or gnus-plugged (not (gnus-agent-method-p gnus-command-method)))
535 (setq gnus-internal-registry-spool-current-method gnus-command-method)
536 (funcall (gnus-get-function gnus-command-method 'request-scan)
537 (and group (gnus-group-real-name group))
538 (nth 1 gnus-command-method)))))
540 (defsubst gnus-request-update-info (info gnus-command-method)
541 "Request that GNUS-COMMAND-METHOD update INFO."
542 (when (stringp gnus-command-method)
543 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
544 (when (gnus-check-backend-function
545 'request-update-info (car gnus-command-method))
546 (let ((group (gnus-info-group info)))
547 (and (funcall (gnus-get-function gnus-command-method
548 'request-update-info)
549 (gnus-group-real-name group)
550 info (nth 1 gnus-command-method))
551 ;; If the minimum article number is greater than 1, then all
552 ;; smaller article numbers are known not to exist; we'll
553 ;; artificially add those to the 'read range.
554 (let* ((active (gnus-active group))
557 (let* ((range (if (= min 2) 1 (cons 1 (1- min))))
558 (read (gnus-info-read info))
559 (new-read (gnus-range-add read (list range))))
560 (gnus-info-set-read info new-read)))
563 (defun gnus-request-expire-articles (articles group &optional force)
564 (let* ((gnus-command-method (gnus-find-method-for-group group))
567 (gnus-get-function gnus-command-method 'request-expire-articles)
568 articles (gnus-group-real-name group) (nth 1 gnus-command-method)
570 (when (and gnus-agent
571 (gnus-agent-method-p gnus-command-method))
572 (let ((expired-articles (gnus-sorted-difference articles not-deleted)))
573 (when expired-articles
574 (gnus-agent-expire expired-articles group 'force))))
577 (defun gnus-request-move-article (article group server accept-function
579 (let* ((gnus-command-method (gnus-find-method-for-group group))
580 (result (funcall (gnus-get-function gnus-command-method
581 'request-move-article)
582 article (gnus-group-real-name group)
583 (nth 1 gnus-command-method) accept-function last)))
584 (when (and result gnus-agent
585 (gnus-agent-method-p gnus-command-method))
586 (gnus-agent-unfetch-articles group (list article)))
589 (defun gnus-request-accept-article (group &optional gnus-command-method last
591 ;; Make sure there's a newline at the end of the article.
592 (when (stringp gnus-command-method)
593 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
594 (when (and (not gnus-command-method)
596 (setq gnus-command-method (or (gnus-find-method-for-group group)
597 (gnus-group-name-to-method group))))
598 (goto-char (point-max))
601 (let ((gnus-command-method (or gnus-command-method
602 (gnus-find-method-for-group group)))
605 (gnus-get-function gnus-command-method 'request-accept-article)
606 (if (stringp group) (gnus-group-real-name group) group)
607 (cadr gnus-command-method)
609 (when (and gnus-agent (gnus-agent-method-p gnus-command-method))
610 (gnus-agent-regenerate-group group (list (cdr result))))
613 (defun gnus-request-replace-article (article group buffer &optional no-encode)
614 (let* ((func (car (gnus-group-name-to-method group)))
615 (result (funcall (intern (format "%s-request-replace-article" func))
616 article (gnus-group-real-name group) buffer)))
617 (when (and gnus-agent (gnus-agent-method-p gnus-command-method))
618 (gnus-agent-regenerate-group group (list article)))
621 (defun gnus-request-associate-buffer (group)
622 (let ((gnus-command-method (gnus-find-method-for-group group)))
623 (funcall (gnus-get-function gnus-command-method 'request-associate-buffer)
624 (gnus-group-real-name group))))
626 (defun gnus-request-restore-buffer (article group)
627 "Request a new buffer restored to the state of ARTICLE."
628 (let ((gnus-command-method (gnus-find-method-for-group group)))
629 (funcall (gnus-get-function gnus-command-method 'request-restore-buffer)
630 article (gnus-group-real-name group)
631 (nth 1 gnus-command-method))))
633 (defun gnus-request-create-group (group &optional gnus-command-method args)
634 (when (stringp gnus-command-method)
635 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
636 (let ((gnus-command-method
637 (or gnus-command-method (gnus-find-method-for-group group))))
638 (funcall (gnus-get-function gnus-command-method 'request-create-group)
639 (gnus-group-real-name group) (nth 1 gnus-command-method) args)))
641 (defun gnus-request-delete-group (group &optional force)
642 (let* ((gnus-command-method (gnus-find-method-for-group group))
644 (funcall (gnus-get-function gnus-command-method 'request-delete-group)
645 (gnus-group-real-name group) force (nth 1 gnus-command-method))))
647 (gnus-cache-delete-group group)
648 (gnus-agent-delete-group group))
651 (defun gnus-request-rename-group (group new-name)
652 (let* ((gnus-command-method (gnus-find-method-for-group group))
654 (funcall (gnus-get-function gnus-command-method 'request-rename-group)
655 (gnus-group-real-name group)
656 (gnus-group-real-name new-name) (nth 1 gnus-command-method))))
658 (gnus-cache-rename-group group new-name)
659 (gnus-agent-rename-group group new-name))
662 (defun gnus-close-backends ()
663 ;; Send a close request to all backends that support such a request.
664 (let ((methods gnus-valid-select-methods)
665 (gnus-inhibit-demon t)
666 func gnus-command-method)
667 (while (setq gnus-command-method (pop methods))
668 (when (fboundp (setq func (intern
669 (concat (car gnus-command-method)
673 (defun gnus-asynchronous-p (gnus-command-method)
674 (let ((func (gnus-get-function gnus-command-method 'asynchronous-p t)))
678 (defun gnus-remove-denial (gnus-command-method)
679 (when (stringp gnus-command-method)
680 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
681 (let* ((elem (assoc gnus-command-method gnus-opened-servers))
682 (status (cadr elem)))
683 ;; If this hasn't been opened before, we add it to the list.
684 (when (eq status 'denied)
685 ;; Set the status of this server.
686 (setcar (cdr elem) 'closed))))
690 ;;; gnus-int.el ends here