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."
62 :type '(repeat symbol))
64 (defvar gnus-internal-registry-spool-current-method nil
65 "The current method, for the registry.")
68 ;;; Server Communication
71 (defun gnus-start-news-server (&optional confirm)
72 "Open a method for getting news.
73 If CONFIRM is non-nil, the user will be asked for an NNTP server."
75 (if gnus-current-select-method
76 ;; Stream is already opened.
79 (unless gnus-nntp-service
80 (setq gnus-nntp-server nil))
82 ;; Read server name with completion.
83 (setq gnus-nntp-server
84 (completing-read "NNTP server: "
86 (cons (list gnus-nntp-server)
87 gnus-secondary-servers))
88 nil nil gnus-nntp-server)))
90 (when (and gnus-nntp-server
91 (stringp gnus-nntp-server)
92 (not (string= gnus-nntp-server "")))
93 (setq gnus-select-method
94 (cond ((or (string= gnus-nntp-server "")
95 (string= gnus-nntp-server "::"))
96 (list 'nnspool (system-name)))
97 ((string-match "^:" gnus-nntp-server)
98 (list 'nnmh gnus-nntp-server
100 (file-name-as-directory
102 (substring gnus-nntp-server 1) "~/")))
103 (list 'nnmh-get-new-mail nil)))
105 (list 'nntp gnus-nntp-server)))))
107 (setq how (car gnus-select-method))
111 (gnus-message 5 "Looking up local news spool..."))
114 (gnus-message 5 "Looking up mh spool..."))
117 (setq gnus-current-select-method gnus-select-method)
118 (gnus-run-hooks 'gnus-open-server-hook)
120 ;; Partially validate agent covered methods now that the
121 ;; gnus-select-method is known.
124 ;; NOTE: This is here for one purpose only. By validating
125 ;; the current select method, it converts the old 5.10.3,
126 ;; and earlier, format to the current format. That enables
127 ;; the agent code within gnus-open-server to function
129 (gnus-agent-read-servers-validate-native gnus-select-method))
132 ;; gnus-open-server-hook might have opened it
133 (gnus-server-opened gnus-select-method)
134 (gnus-open-server gnus-select-method)
138 "%s (%s) open error: '%s'. Continue? "
139 (car gnus-select-method) (cadr gnus-select-method)
140 (gnus-status-message gnus-select-method)))
141 (gnus-error 1 "Couldn't open server on %s"
142 (nth 1 gnus-select-method))))))
144 (defun gnus-check-group (group)
145 "Try to make sure that the server where GROUP exists is alive."
146 (let ((method (gnus-find-method-for-group group)))
147 (or (gnus-server-opened method)
148 (gnus-open-server method))))
150 (defun gnus-check-server (&optional method silent)
151 "Check whether the connection to METHOD is down.
152 If METHOD is nil, use `gnus-select-method'.
153 If it is down, start it up (again)."
154 (let ((method (or method gnus-select-method))
156 ;; Transform virtual server names into select methods.
157 (when (stringp method)
158 (setq method (gnus-server-to-method method)))
159 (if (gnus-server-opened method)
160 ;; The stream is already opened.
164 (gnus-message 5 "Opening %s server%s..." (car method)
165 (if (equal (nth 1 method) "") ""
166 (format " on %s" (nth 1 method)))))
167 (gnus-run-hooks 'gnus-open-server-hook)
170 (setq result (gnus-open-server method))
171 (quit (message "Quit gnus-check-server")
174 (gnus-message 5 "Opening %s server%s...%s" (car method)
175 (if (equal (nth 1 method) "") ""
176 (format " on %s" (nth 1 method)))
177 (if result "done" "failed")))))))
179 (defun gnus-get-function (method function &optional noerror)
180 "Return a function symbol based on METHOD and FUNCTION."
181 ;; Translate server names into methods.
183 (error "Attempted use of a nil select method"))
184 (when (stringp method)
185 (setq method (gnus-server-to-method method)))
186 ;; Check cache of constructed names.
187 (let* ((method-sym (if gnus-agent
188 (inline (gnus-agent-get-function method))
190 (method-fns (get method-sym 'gnus-method-functions))
191 (func (let ((method-fnlist-elt (assq function method-fns)))
192 (unless method-fnlist-elt
193 (setq method-fnlist-elt
195 (intern (format "%s-%s" method-sym function))))
196 (put method-sym 'gnus-method-functions
197 (cons method-fnlist-elt method-fns)))
198 (cdr method-fnlist-elt))))
199 ;; Maybe complain if there is no function.
200 (unless (fboundp func)
202 (error "Trying to require a method that doesn't exist"))
203 (require (car method))
204 (when (not (fboundp func))
207 (error "No such function: %s" func))))
212 ;;; Interface functions to the backends.
215 (defun gnus-open-server (gnus-command-method)
216 "Open a connection to GNUS-COMMAND-METHOD."
217 (when (stringp gnus-command-method)
218 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
219 (let ((elem (assoc gnus-command-method gnus-opened-servers)))
220 ;; If this method was previously denied, we just return nil.
221 (if (eq (nth 1 elem) 'denied)
223 (gnus-message 1 "Denied server")
226 (let* ((open-server-function (gnus-get-function gnus-command-method 'open-server))
229 (funcall open-server-function
230 (nth 1 gnus-command-method)
231 (nthcdr 2 gnus-command-method))
233 (gnus-message 1 (format
234 "Unable to open server due to: %s"
235 (error-message-string err)))
238 (gnus-message 1 "Quit trying to open server")
241 ;; If this hasn't been opened before, we add it to the list.
243 (setq elem (list gnus-command-method nil)
244 gnus-opened-servers (cons elem gnus-opened-servers)))
245 ;; Set the status of this server.
248 (if (eq open-server-function #'nnagent-open-server)
249 ;; The agent's backend has a "special" status
253 (gnus-agent-method-p gnus-command-method))
254 (cond (gnus-server-unopen-status
255 ;; Set the server's status to the unopen
256 ;; status. If that status is offline,
257 ;; recurse to open the agent's backend.
258 (setq open-offline (eq gnus-server-unopen-status 'offline))
259 gnus-server-unopen-status)
261 (format "Unable to open %s:%s, go offline? "
262 (car gnus-command-method)
263 (cadr gnus-command-method)))
264 (setq open-offline t)
267 ;; This agentized server was still denied
270 ;; This unagentized server must be denied
273 ;; NOTE: I MUST set the server's status to offline before this
274 ;; recursive call as this status will drive the
275 ;; gnus-get-function (called above) to return the agent's
278 ;; Recursively open this offline server to perform the
279 ;; open-server function of the agent's backend.
280 (let ((gnus-server-unopen-status 'denied))
281 ;; Bind gnus-server-unopen-status to avoid recursively
282 ;; prompting with "go offline?". This is only a concern
283 ;; when the agent's backend fails to open the server.
284 (gnus-open-server gnus-command-method))
287 (defun gnus-close-server (gnus-command-method)
288 "Close the connection to GNUS-COMMAND-METHOD."
289 (when (stringp gnus-command-method)
290 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
291 (funcall (gnus-get-function gnus-command-method 'close-server)
292 (nth 1 gnus-command-method)))
294 (defun gnus-request-list (gnus-command-method)
295 "Request the active file from GNUS-COMMAND-METHOD."
296 (when (stringp gnus-command-method)
297 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
298 (funcall (gnus-get-function gnus-command-method 'request-list)
299 (nth 1 gnus-command-method)))
301 (defun gnus-request-list-newsgroups (gnus-command-method)
302 "Request the newsgroups file from GNUS-COMMAND-METHOD."
303 (when (stringp gnus-command-method)
304 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
305 (funcall (gnus-get-function gnus-command-method 'request-list-newsgroups)
306 (nth 1 gnus-command-method)))
308 (defun gnus-request-newgroups (date gnus-command-method)
309 "Request all new groups since DATE from GNUS-COMMAND-METHOD."
310 (when (stringp gnus-command-method)
311 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
312 (let ((func (gnus-get-function gnus-command-method 'request-newgroups t)))
314 (funcall func date (nth 1 gnus-command-method)))))
316 (defun gnus-server-opened (gnus-command-method)
317 "Check whether a connection to GNUS-COMMAND-METHOD has been opened."
318 (unless (eq (gnus-server-status gnus-command-method)
320 (when (stringp gnus-command-method)
321 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
322 (funcall (inline (gnus-get-function gnus-command-method 'server-opened))
323 (nth 1 gnus-command-method))))
325 (defun gnus-status-message (gnus-command-method)
326 "Return the status message from GNUS-COMMAND-METHOD.
327 If GNUS-COMMAND-METHOD is a string, it is interpreted as a group
328 name. The method this group uses will be queried."
329 (let ((gnus-command-method
330 (if (stringp gnus-command-method)
331 (gnus-find-method-for-group gnus-command-method)
332 gnus-command-method)))
333 (funcall (gnus-get-function gnus-command-method 'status-message)
334 (nth 1 gnus-command-method))))
336 (defun gnus-request-regenerate (gnus-command-method)
337 "Request a data generation from GNUS-COMMAND-METHOD."
338 (when (stringp gnus-command-method)
339 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
340 (funcall (gnus-get-function gnus-command-method 'request-regenerate)
341 (nth 1 gnus-command-method)))
343 (defun gnus-request-group (group &optional dont-check gnus-command-method)
344 "Request GROUP. If DONT-CHECK, no information is required."
345 (let ((gnus-command-method
346 (or gnus-command-method (inline (gnus-find-method-for-group group)))))
347 (when (stringp gnus-command-method)
348 (setq gnus-command-method
349 (inline (gnus-server-to-method gnus-command-method))))
350 (funcall (inline (gnus-get-function gnus-command-method 'request-group))
351 (gnus-group-real-name group) (nth 1 gnus-command-method)
354 (defun gnus-list-active-group (group)
355 "Request active information on GROUP."
356 (let ((gnus-command-method (gnus-find-method-for-group group))
357 (func 'list-active-group))
358 (when (gnus-check-backend-function func group)
359 (funcall (gnus-get-function gnus-command-method func)
360 (gnus-group-real-name group) (nth 1 gnus-command-method)))))
362 (defun gnus-request-group-description (group)
363 "Request a description of GROUP."
364 (let ((gnus-command-method (gnus-find-method-for-group group))
365 (func 'request-group-description))
366 (when (gnus-check-backend-function func group)
367 (funcall (gnus-get-function gnus-command-method func)
368 (gnus-group-real-name group) (nth 1 gnus-command-method)))))
370 (defun gnus-request-group-articles (group)
371 "Request a list of existing articles in GROUP."
372 (let ((gnus-command-method (gnus-find-method-for-group group))
373 (func 'request-group-articles))
374 (when (gnus-check-backend-function func group)
375 (funcall (gnus-get-function gnus-command-method func)
376 (gnus-group-real-name group) (nth 1 gnus-command-method)))))
378 (defun gnus-close-group (group)
379 "Request the GROUP be closed."
380 (let ((gnus-command-method (inline (gnus-find-method-for-group group))))
381 (funcall (gnus-get-function gnus-command-method 'close-group)
382 (gnus-group-real-name group) (nth 1 gnus-command-method))))
384 (defun gnus-retrieve-headers (articles group &optional fetch-old)
385 "Request headers for ARTICLES in GROUP.
386 If FETCH-OLD, retrieve all headers (or some subset thereof) in the group."
387 (let ((gnus-command-method (gnus-find-method-for-group group)))
389 ((and gnus-use-cache (numberp (car articles)))
390 (gnus-cache-retrieve-headers articles group fetch-old))
391 ((and gnus-agent (gnus-online gnus-command-method)
392 (gnus-agent-method-p gnus-command-method))
393 (gnus-agent-retrieve-headers articles group fetch-old))
395 (funcall (gnus-get-function gnus-command-method 'retrieve-headers)
396 articles (gnus-group-real-name group)
397 (nth 1 gnus-command-method) fetch-old)))))
399 (defun gnus-retrieve-articles (articles group)
400 "Request ARTICLES in GROUP."
401 (let ((gnus-command-method (gnus-find-method-for-group group)))
402 (funcall (gnus-get-function gnus-command-method 'retrieve-articles)
403 articles (gnus-group-real-name group)
404 (nth 1 gnus-command-method))))
406 (defun gnus-retrieve-groups (groups gnus-command-method)
407 "Request active information on GROUPS from GNUS-COMMAND-METHOD."
408 (when (stringp gnus-command-method)
409 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
410 (funcall (gnus-get-function gnus-command-method 'retrieve-groups)
411 groups (nth 1 gnus-command-method)))
413 (defun gnus-request-type (group &optional article)
414 "Return the type (`post' or `mail') of GROUP (and ARTICLE)."
415 (let ((gnus-command-method (gnus-find-method-for-group group)))
416 (if (not (gnus-check-backend-function
417 'request-type (car gnus-command-method)))
419 (funcall (gnus-get-function gnus-command-method 'request-type)
420 (gnus-group-real-name group) article))))
422 (defun gnus-request-set-mark (group action)
423 "Set marks on articles in the back end."
424 (let* ((gnus-command-method (gnus-find-method-for-group group))
425 (gnus-agent (if (member (car gnus-command-method)
426 gnus-servers-that-use-local-marks)
429 (if (not (gnus-check-backend-function
430 'request-set-mark (car gnus-command-method)))
432 (funcall (gnus-get-function gnus-command-method 'request-set-mark)
433 (gnus-group-real-name group) action
434 (nth 1 gnus-command-method)))))
436 (defun gnus-request-update-mark (group article mark)
437 "Allow the back end to change the mark the user tries to put on an article."
438 (let* ((gnus-command-method (gnus-find-method-for-group group))
439 (gnus-agent (if (member (car gnus-command-method)
440 gnus-servers-that-use-local-marks)
443 (if (not (gnus-check-backend-function
444 'request-update-mark (car gnus-command-method)))
446 (funcall (gnus-get-function gnus-command-method 'request-update-mark)
447 (gnus-group-real-name group) article mark))))
449 (defun gnus-request-article (article group &optional buffer)
450 "Request the ARTICLE in GROUP.
451 ARTICLE can either be an article number or an article Message-ID.
452 If BUFFER, insert the article in that group."
453 (let ((gnus-command-method (gnus-find-method-for-group group)))
454 (funcall (gnus-get-function gnus-command-method 'request-article)
455 article (gnus-group-real-name group)
456 (nth 1 gnus-command-method) buffer)))
458 (defun gnus-request-head (article group)
459 "Request the head of ARTICLE in GROUP."
460 (let* ((gnus-command-method (gnus-find-method-for-group group))
461 (head (gnus-get-function gnus-command-method 'request-head t))
467 (gnus-cache-request-article article group))
468 (setq res (cons group article)
470 ;; Check the agent cache.
471 ((gnus-agent-request-article article group)
472 (setq res (cons group article)
474 ;; Use `head' function.
476 (setq res (funcall head article (gnus-group-real-name group)
477 (nth 1 gnus-command-method))))
478 ;; Use `article' function.
480 (setq res (gnus-request-article article group)
484 (set-buffer nntp-server-buffer)
485 (goto-char (point-min))
486 (when (search-forward "\n\n" nil t)
487 (delete-region (1- (point)) (point-max)))
488 (nnheader-fold-continuation-lines)))
491 (defun gnus-request-body (article group)
492 "Request the body of ARTICLE in GROUP."
493 (let* ((gnus-command-method (gnus-find-method-for-group group))
494 (head (gnus-get-function gnus-command-method 'request-body t))
500 (gnus-cache-request-article article group))
501 (setq res (cons group article)
503 ;; Check the agent cache.
504 ((gnus-agent-request-article article group)
505 (setq res (cons group article)
507 ;; Use `head' function.
509 (setq res (funcall head article (gnus-group-real-name group)
510 (nth 1 gnus-command-method))))
511 ;; Use `article' function.
513 (setq res (gnus-request-article article group)
517 (set-buffer nntp-server-buffer)
518 (goto-char (point-min))
519 (when (search-forward "\n\n" nil t)
520 (delete-region (point-min) (1- (point))))))
523 (defun gnus-request-post (gnus-command-method)
524 "Post the current buffer using GNUS-COMMAND-METHOD."
525 (when (stringp gnus-command-method)
526 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
527 (funcall (gnus-get-function gnus-command-method 'request-post)
528 (nth 1 gnus-command-method)))
530 (defun gnus-request-scan (group gnus-command-method)
531 "Request a SCAN being performed in GROUP from GNUS-COMMAND-METHOD.
532 If GROUP is nil, all groups on GNUS-COMMAND-METHOD are scanned."
533 (let ((gnus-command-method
534 (if group (gnus-find-method-for-group group) gnus-command-method))
535 (gnus-inhibit-demon t)
536 (mail-source-plugged gnus-plugged))
537 (when (or gnus-plugged (not (gnus-agent-method-p gnus-command-method)))
538 (setq gnus-internal-registry-spool-current-method gnus-command-method)
539 (funcall (gnus-get-function gnus-command-method 'request-scan)
540 (and group (gnus-group-real-name group))
541 (nth 1 gnus-command-method)))))
543 (defsubst gnus-request-update-info (info gnus-command-method)
544 "Request that GNUS-COMMAND-METHOD update INFO."
545 (when (stringp gnus-command-method)
546 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
547 (when (gnus-check-backend-function
548 'request-update-info (car gnus-command-method))
549 (let ((group (gnus-info-group info)))
550 (and (funcall (gnus-get-function gnus-command-method
551 'request-update-info)
552 (gnus-group-real-name group)
553 info (nth 1 gnus-command-method))
554 ;; If the minimum article number is greater than 1, then all
555 ;; smaller article numbers are known not to exist; we'll
556 ;; artificially add those to the 'read range.
557 (let* ((active (gnus-active group))
560 (let* ((range (if (= min 2) 1 (cons 1 (1- min))))
561 (read (gnus-info-read info))
562 (new-read (gnus-range-add read (list range))))
563 (gnus-info-set-read info new-read)))
566 (defun gnus-request-expire-articles (articles group &optional force)
567 (let* ((gnus-command-method (gnus-find-method-for-group group))
570 (gnus-get-function gnus-command-method 'request-expire-articles)
571 articles (gnus-group-real-name group) (nth 1 gnus-command-method)
573 (when (and gnus-agent
574 (gnus-agent-method-p gnus-command-method))
575 (let ((expired-articles (gnus-sorted-difference articles not-deleted)))
576 (when expired-articles
577 (gnus-agent-expire expired-articles group 'force))))
580 (defun gnus-request-move-article (article group server accept-function
582 (let* ((gnus-command-method (gnus-find-method-for-group group))
583 (result (funcall (gnus-get-function gnus-command-method
584 'request-move-article)
585 article (gnus-group-real-name group)
586 (nth 1 gnus-command-method) accept-function last)))
587 (when (and result gnus-agent
588 (gnus-agent-method-p gnus-command-method))
589 (gnus-agent-unfetch-articles group (list article)))
592 (defun gnus-request-accept-article (group &optional gnus-command-method last
594 ;; Make sure there's a newline at the end of the article.
595 (when (stringp gnus-command-method)
596 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
597 (when (and (not gnus-command-method)
599 (setq gnus-command-method (or (gnus-find-method-for-group group)
600 (gnus-group-name-to-method group))))
601 (goto-char (point-max))
604 (let ((gnus-command-method (or gnus-command-method
605 (gnus-find-method-for-group group)))
608 (gnus-get-function gnus-command-method 'request-accept-article)
609 (if (stringp group) (gnus-group-real-name group) group)
610 (cadr gnus-command-method)
612 (when (and gnus-agent (gnus-agent-method-p gnus-command-method))
613 (gnus-agent-regenerate-group group (list (cdr result))))
616 (defun gnus-request-replace-article (article group buffer &optional no-encode)
617 (let* ((func (car (gnus-group-name-to-method group)))
618 (result (funcall (intern (format "%s-request-replace-article" func))
619 article (gnus-group-real-name group) buffer)))
620 (when (and gnus-agent (gnus-agent-method-p gnus-command-method))
621 (gnus-agent-regenerate-group group (list article)))
624 (defun gnus-request-associate-buffer (group)
625 (let ((gnus-command-method (gnus-find-method-for-group group)))
626 (funcall (gnus-get-function gnus-command-method 'request-associate-buffer)
627 (gnus-group-real-name group))))
629 (defun gnus-request-restore-buffer (article group)
630 "Request a new buffer restored to the state of ARTICLE."
631 (let ((gnus-command-method (gnus-find-method-for-group group)))
632 (funcall (gnus-get-function gnus-command-method 'request-restore-buffer)
633 article (gnus-group-real-name group)
634 (nth 1 gnus-command-method))))
636 (defun gnus-request-create-group (group &optional gnus-command-method args)
637 (when (stringp gnus-command-method)
638 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
639 (let ((gnus-command-method
640 (or gnus-command-method (gnus-find-method-for-group group))))
641 (funcall (gnus-get-function gnus-command-method 'request-create-group)
642 (gnus-group-real-name group) (nth 1 gnus-command-method) args)))
644 (defun gnus-request-delete-group (group &optional force)
645 (let* ((gnus-command-method (gnus-find-method-for-group group))
647 (funcall (gnus-get-function gnus-command-method 'request-delete-group)
648 (gnus-group-real-name group) force (nth 1 gnus-command-method))))
650 (gnus-cache-delete-group group)
651 (gnus-agent-delete-group group))
654 (defun gnus-request-rename-group (group new-name)
655 (let* ((gnus-command-method (gnus-find-method-for-group group))
657 (funcall (gnus-get-function gnus-command-method 'request-rename-group)
658 (gnus-group-real-name group)
659 (gnus-group-real-name new-name) (nth 1 gnus-command-method))))
661 (gnus-cache-rename-group group new-name)
662 (gnus-agent-rename-group group new-name))
665 (defun gnus-close-backends ()
666 ;; Send a close request to all backends that support such a request.
667 (let ((methods gnus-valid-select-methods)
668 (gnus-inhibit-demon t)
669 func gnus-command-method)
670 (while (setq gnus-command-method (pop methods))
671 (when (fboundp (setq func (intern
672 (concat (car gnus-command-method)
676 (defun gnus-asynchronous-p (gnus-command-method)
677 (let ((func (gnus-get-function gnus-command-method 'asynchronous-p t)))
681 (defun gnus-remove-denial (gnus-command-method)
682 (when (stringp gnus-command-method)
683 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
684 (let* ((elem (assoc gnus-command-method gnus-opened-servers))
685 (status (cadr elem)))
686 ;; If this hasn't been opened before, we add it to the list.
687 (when (eq status 'denied)
688 ;; Set the status of this server.
689 (setcar (cdr elem) 'closed))))
693 ;;; gnus-int.el ends here