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>
8 ;; This file is part of GNU Emacs.
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
29 (eval-when-compile (require 'cl))
35 (autoload 'gnus-agent-expire "gnus-agent")
36 (autoload 'gnus-agent-regenerate-group "gnus-agent")
37 (autoload 'gnus-agent-read-servers-validate-native "gnus-agent")
39 (defcustom gnus-open-server-hook nil
40 "Hook called just before opening connection to the news server."
44 (defcustom gnus-server-unopen-status nil
45 "The default status if the server is not able to open.
46 If the server is covered by Gnus agent, the possible values are
47 `denied', set the server denied; `offline', set the server offline;
48 nil, ask user. If the server is not covered by Gnus agent, set the
52 :type '(choice (const :tag "Ask" nil)
53 (const :tag "Deny server" denied)
54 (const :tag "Unplug Agent" offline)))
56 (defcustom gnus-servers-that-use-local-marks '(nntp)
57 "A list of backends that store marks locally. This means that
58 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-agent (if (member (car gnus-command-method)
425 gnus-servers-that-use-local-marks)
428 (if (not (gnus-check-backend-function
429 'request-set-mark (car gnus-command-method)))
431 (funcall (gnus-get-function gnus-command-method 'request-set-mark)
432 (gnus-group-real-name group) action
433 (nth 1 gnus-command-method)))))
435 (defun gnus-request-update-mark (group article mark)
436 "Allow the back end to change the mark the user tries to put on an article."
437 (let* ((gnus-command-method (gnus-find-method-for-group group))
438 (gnus-agent (if (member (car gnus-command-method)
439 gnus-servers-that-use-local-marks)
442 (if (not (gnus-check-backend-function
443 'request-update-mark (car gnus-command-method)))
445 (funcall (gnus-get-function gnus-command-method 'request-update-mark)
446 (gnus-group-real-name group) article mark))))
448 (defun gnus-request-article (article group &optional buffer)
449 "Request the ARTICLE in GROUP.
450 ARTICLE can either be an article number or an article Message-ID.
451 If BUFFER, insert the article in that group."
452 (let ((gnus-command-method (gnus-find-method-for-group group)))
453 (funcall (gnus-get-function gnus-command-method 'request-article)
454 article (gnus-group-real-name group)
455 (nth 1 gnus-command-method) buffer)))
457 (defun gnus-request-head (article group)
458 "Request the head of ARTICLE in GROUP."
459 (let* ((gnus-command-method (gnus-find-method-for-group group))
460 (head (gnus-get-function gnus-command-method 'request-head t))
466 (gnus-cache-request-article article group))
467 (setq res (cons group article)
469 ;; Check the agent cache.
470 ((gnus-agent-request-article article group)
471 (setq res (cons group article)
473 ;; Use `head' function.
475 (setq res (funcall head article (gnus-group-real-name group)
476 (nth 1 gnus-command-method))))
477 ;; Use `article' function.
479 (setq res (gnus-request-article article group)
483 (set-buffer nntp-server-buffer)
484 (goto-char (point-min))
485 (when (search-forward "\n\n" nil t)
486 (delete-region (1- (point)) (point-max)))
487 (nnheader-fold-continuation-lines)))
490 (defun gnus-request-body (article group)
491 "Request the body of ARTICLE in GROUP."
492 (let* ((gnus-command-method (gnus-find-method-for-group group))
493 (head (gnus-get-function gnus-command-method 'request-body t))
499 (gnus-cache-request-article article group))
500 (setq res (cons group article)
502 ;; Check the agent cache.
503 ((gnus-agent-request-article article group)
504 (setq res (cons group article)
506 ;; Use `head' function.
508 (setq res (funcall head article (gnus-group-real-name group)
509 (nth 1 gnus-command-method))))
510 ;; Use `article' function.
512 (setq res (gnus-request-article article group)
516 (set-buffer nntp-server-buffer)
517 (goto-char (point-min))
518 (when (search-forward "\n\n" nil t)
519 (delete-region (point-min) (1- (point))))))
522 (defun gnus-request-post (gnus-command-method)
523 "Post the current buffer using GNUS-COMMAND-METHOD."
524 (when (stringp gnus-command-method)
525 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
526 (funcall (gnus-get-function gnus-command-method 'request-post)
527 (nth 1 gnus-command-method)))
529 (defun gnus-request-scan (group gnus-command-method)
530 "Request a SCAN being performed in GROUP from GNUS-COMMAND-METHOD.
531 If GROUP is nil, all groups on GNUS-COMMAND-METHOD are scanned."
532 (let ((gnus-command-method
533 (if group (gnus-find-method-for-group group) gnus-command-method))
534 (gnus-inhibit-demon t)
535 (mail-source-plugged gnus-plugged))
536 (when (or gnus-plugged (not (gnus-agent-method-p gnus-command-method)))
537 (setq gnus-internal-registry-spool-current-method gnus-command-method)
538 (funcall (gnus-get-function gnus-command-method 'request-scan)
539 (and group (gnus-group-real-name group))
540 (nth 1 gnus-command-method)))))
542 (defsubst gnus-request-update-info (info gnus-command-method)
543 "Request that GNUS-COMMAND-METHOD update INFO."
544 (when (stringp gnus-command-method)
545 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
546 (when (gnus-check-backend-function
547 'request-update-info (car gnus-command-method))
548 (let ((group (gnus-info-group info)))
549 (and (funcall (gnus-get-function gnus-command-method
550 'request-update-info)
551 (gnus-group-real-name group)
552 info (nth 1 gnus-command-method))
553 ;; If the minimum article number is greater than 1, then all
554 ;; smaller article numbers are known not to exist; we'll
555 ;; artificially add those to the 'read range.
556 (let* ((active (gnus-active group))
559 (let* ((range (if (= min 2) 1 (cons 1 (1- min))))
560 (read (gnus-info-read info))
561 (new-read (gnus-range-add read (list range))))
562 (gnus-info-set-read info new-read)))
565 (defun gnus-request-expire-articles (articles group &optional force)
566 (let* ((gnus-command-method (gnus-find-method-for-group group))
569 (gnus-get-function gnus-command-method 'request-expire-articles)
570 articles (gnus-group-real-name group) (nth 1 gnus-command-method)
572 (when (and gnus-agent
573 (gnus-agent-method-p gnus-command-method))
574 (let ((expired-articles (gnus-sorted-difference articles not-deleted)))
575 (when expired-articles
576 (gnus-agent-expire expired-articles group 'force))))
579 (defun gnus-request-move-article (article group server accept-function
581 (let* ((gnus-command-method (gnus-find-method-for-group group))
582 (result (funcall (gnus-get-function gnus-command-method
583 'request-move-article)
584 article (gnus-group-real-name group)
585 (nth 1 gnus-command-method) accept-function last)))
586 (when (and result gnus-agent
587 (gnus-agent-method-p gnus-command-method))
588 (gnus-agent-unfetch-articles group (list article)))
591 (defun gnus-request-accept-article (group &optional gnus-command-method last
593 ;; Make sure there's a newline at the end of the article.
594 (when (stringp gnus-command-method)
595 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
596 (when (and (not gnus-command-method)
598 (setq gnus-command-method (or (gnus-find-method-for-group group)
599 (gnus-group-name-to-method group))))
600 (goto-char (point-max))
604 (let ((message-options message-options))
605 (message-options-set-recipient)
607 (message-narrow-to-head)
608 (let ((mail-parse-charset message-default-charset))
609 (mail-encode-encoded-word-buffer)))
610 (message-encode-message-body)))
611 (let ((gnus-command-method (or gnus-command-method
612 (gnus-find-method-for-group group)))
615 (gnus-get-function gnus-command-method 'request-accept-article)
616 (if (stringp group) (gnus-group-real-name group) group)
617 (cadr gnus-command-method)
619 (when (and gnus-agent (gnus-agent-method-p gnus-command-method))
620 (gnus-agent-regenerate-group group (list (cdr result))))
623 (defun gnus-request-replace-article (article group buffer &optional no-encode)
625 (let ((message-options message-options))
626 (message-options-set-recipient)
628 (message-narrow-to-head)
629 (let ((mail-parse-charset message-default-charset))
630 (mail-encode-encoded-word-buffer)))
631 (message-encode-message-body)))
632 (let* ((func (car (gnus-group-name-to-method group)))
633 (result (funcall (intern (format "%s-request-replace-article" func))
634 article (gnus-group-real-name group) buffer)))
635 (when (and gnus-agent (gnus-agent-method-p gnus-command-method))
636 (gnus-agent-regenerate-group group (list article)))
639 (defun gnus-request-associate-buffer (group)
640 (let ((gnus-command-method (gnus-find-method-for-group group)))
641 (funcall (gnus-get-function gnus-command-method 'request-associate-buffer)
642 (gnus-group-real-name group))))
644 (defun gnus-request-restore-buffer (article group)
645 "Request a new buffer restored to the state of ARTICLE."
646 (let ((gnus-command-method (gnus-find-method-for-group group)))
647 (funcall (gnus-get-function gnus-command-method 'request-restore-buffer)
648 article (gnus-group-real-name group)
649 (nth 1 gnus-command-method))))
651 (defun gnus-request-create-group (group &optional gnus-command-method args)
652 (when (stringp gnus-command-method)
653 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
654 (let ((gnus-command-method
655 (or gnus-command-method (gnus-find-method-for-group group))))
656 (funcall (gnus-get-function gnus-command-method 'request-create-group)
657 (gnus-group-real-name group) (nth 1 gnus-command-method) args)))
659 (defun gnus-request-delete-group (group &optional force)
660 (let* ((gnus-command-method (gnus-find-method-for-group group))
662 (funcall (gnus-get-function gnus-command-method 'request-delete-group)
663 (gnus-group-real-name group) force (nth 1 gnus-command-method))))
665 (gnus-cache-delete-group group)
666 (gnus-agent-delete-group group))
669 (defun gnus-request-rename-group (group new-name)
670 (let* ((gnus-command-method (gnus-find-method-for-group group))
672 (funcall (gnus-get-function gnus-command-method 'request-rename-group)
673 (gnus-group-real-name group)
674 (gnus-group-real-name new-name) (nth 1 gnus-command-method))))
676 (gnus-cache-rename-group group new-name)
677 (gnus-agent-rename-group group new-name))
680 (defun gnus-close-backends ()
681 ;; Send a close request to all backends that support such a request.
682 (let ((methods gnus-valid-select-methods)
683 (gnus-inhibit-demon t)
684 func gnus-command-method)
685 (while (setq gnus-command-method (pop methods))
686 (when (fboundp (setq func (intern
687 (concat (car gnus-command-method)
691 (defun gnus-asynchronous-p (gnus-command-method)
692 (let ((func (gnus-get-function gnus-command-method 'asynchronous-p t)))
696 (defun gnus-remove-denial (gnus-command-method)
697 (when (stringp gnus-command-method)
698 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
699 (let* ((elem (assoc gnus-command-method gnus-opened-servers))
700 (status (cadr elem)))
701 ;; If this hasn't been opened before, we add it to the list.
702 (when (eq status 'denied)
703 ;; Set the status of this server.
704 (setcar (cdr elem) 'closed))))
708 ;;; arch-tag: bbc90087-9b7f-4017-a92c-3abf180ac86d
709 ;;; gnus-int.el ends here