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."
60 :type '(repeat symbol))
62 (defvar gnus-internal-registry-spool-current-method nil
63 "The current method, for the registry.")
66 ;;; Server Communication
69 (defun gnus-start-news-server (&optional confirm)
70 "Open a method for getting news.
71 If CONFIRM is non-nil, the user will be asked for an NNTP server."
73 (if gnus-current-select-method
74 ;; Stream is already opened.
77 (unless gnus-nntp-service
78 (setq gnus-nntp-server nil))
80 ;; Read server name with completion.
81 (setq gnus-nntp-server
82 (completing-read "NNTP server: "
84 (cons (list gnus-nntp-server)
85 gnus-secondary-servers))
86 nil nil gnus-nntp-server)))
88 (when (and gnus-nntp-server
89 (stringp gnus-nntp-server)
90 (not (string= gnus-nntp-server "")))
91 (setq gnus-select-method
92 (cond ((or (string= gnus-nntp-server "")
93 (string= gnus-nntp-server "::"))
94 (list 'nnspool (system-name)))
95 ((string-match "^:" gnus-nntp-server)
96 (list 'nnmh gnus-nntp-server
98 (file-name-as-directory
100 (substring gnus-nntp-server 1) "~/")))
101 (list 'nnmh-get-new-mail nil)))
103 (list 'nntp gnus-nntp-server)))))
105 (setq how (car gnus-select-method))
109 (gnus-message 5 "Looking up local news spool..."))
112 (gnus-message 5 "Looking up mh spool..."))
115 (setq gnus-current-select-method gnus-select-method)
116 (gnus-run-hooks 'gnus-open-server-hook)
118 ;; Partially validate agent covered methods now that the
119 ;; gnus-select-method is known.
122 ;; NOTE: This is here for one purpose only. By validating
123 ;; the current select method, it converts the old 5.10.3,
124 ;; and earlier, format to the current format. That enables
125 ;; the agent code within gnus-open-server to function
127 (gnus-agent-read-servers-validate-native gnus-select-method))
130 ;; gnus-open-server-hook might have opened it
131 (gnus-server-opened gnus-select-method)
132 (gnus-open-server gnus-select-method)
136 "%s (%s) open error: '%s'. Continue? "
137 (car gnus-select-method) (cadr gnus-select-method)
138 (gnus-status-message gnus-select-method)))
139 (gnus-error 1 "Couldn't open server on %s"
140 (nth 1 gnus-select-method))))))
142 (defun gnus-check-group (group)
143 "Try to make sure that the server where GROUP exists is alive."
144 (let ((method (gnus-find-method-for-group group)))
145 (or (gnus-server-opened method)
146 (gnus-open-server method))))
148 (defun gnus-check-server (&optional method silent)
149 "Check whether the connection to METHOD is down.
150 If METHOD is nil, use `gnus-select-method'.
151 If it is down, start it up (again)."
152 (let ((method (or method gnus-select-method))
154 ;; Transform virtual server names into select methods.
155 (when (stringp method)
156 (setq method (gnus-server-to-method method)))
157 (if (gnus-server-opened method)
158 ;; The stream is already opened.
162 (gnus-message 5 "Opening %s server%s..." (car method)
163 (if (equal (nth 1 method) "") ""
164 (format " on %s" (nth 1 method)))))
165 (gnus-run-hooks 'gnus-open-server-hook)
168 (setq result (gnus-open-server method))
169 (quit (message "Quit gnus-check-server")
172 (gnus-message 5 "Opening %s server%s...%s" (car method)
173 (if (equal (nth 1 method) "") ""
174 (format " on %s" (nth 1 method)))
175 (if result "done" "failed")))))))
177 (defun gnus-get-function (method function &optional noerror)
178 "Return a function symbol based on METHOD and FUNCTION."
179 ;; Translate server names into methods.
181 (error "Attempted use of a nil select method"))
182 (when (stringp method)
183 (setq method (gnus-server-to-method method)))
184 ;; Check cache of constructed names.
185 (let* ((method-sym (if gnus-agent
186 (inline (gnus-agent-get-function method))
188 (method-fns (get method-sym 'gnus-method-functions))
189 (func (let ((method-fnlist-elt (assq function method-fns)))
190 (unless method-fnlist-elt
191 (setq method-fnlist-elt
193 (intern (format "%s-%s" method-sym function))))
194 (put method-sym 'gnus-method-functions
195 (cons method-fnlist-elt method-fns)))
196 (cdr method-fnlist-elt))))
197 ;; Maybe complain if there is no function.
198 (unless (fboundp func)
200 (error "Trying to require a method that doesn't exist"))
201 (require (car method))
202 (when (not (fboundp func))
205 (error "No such function: %s" func))))
210 ;;; Interface functions to the backends.
213 (defun gnus-open-server (gnus-command-method)
214 "Open a connection to GNUS-COMMAND-METHOD."
215 (when (stringp gnus-command-method)
216 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
217 (let ((elem (assoc gnus-command-method gnus-opened-servers)))
218 ;; If this method was previously denied, we just return nil.
219 (if (eq (nth 1 elem) 'denied)
221 (gnus-message 1 "Denied server")
224 (let* ((open-server-function (gnus-get-function gnus-command-method 'open-server))
227 (funcall open-server-function
228 (nth 1 gnus-command-method)
229 (nthcdr 2 gnus-command-method))
231 (gnus-message 1 (format
232 "Unable to open server due to: %s"
233 (error-message-string err)))
236 (gnus-message 1 "Quit trying to open server")
239 ;; If this hasn't been opened before, we add it to the list.
241 (setq elem (list gnus-command-method nil)
242 gnus-opened-servers (cons elem gnus-opened-servers)))
243 ;; Set the status of this server.
246 (if (eq open-server-function #'nnagent-open-server)
247 ;; The agent's backend has a "special" status
251 (gnus-agent-method-p gnus-command-method))
252 (cond (gnus-server-unopen-status
253 ;; Set the server's status to the unopen
254 ;; status. If that status is offline,
255 ;; recurse to open the agent's backend.
256 (setq open-offline (eq gnus-server-unopen-status 'offline))
257 gnus-server-unopen-status)
259 (format "Unable to open %s:%s, go offline? "
260 (car gnus-command-method)
261 (cadr gnus-command-method)))
262 (setq open-offline t)
265 ;; This agentized server was still denied
268 ;; This unagentized server must be denied
271 ;; NOTE: I MUST set the server's status to offline before this
272 ;; recursive call as this status will drive the
273 ;; gnus-get-function (called above) to return the agent's
276 ;; Recursively open this offline server to perform the
277 ;; open-server function of the agent's backend.
278 (let ((gnus-server-unopen-status 'denied))
279 ;; Bind gnus-server-unopen-status to avoid recursively
280 ;; prompting with "go offline?". This is only a concern
281 ;; when the agent's backend fails to open the server.
282 (gnus-open-server gnus-command-method))
285 (defun gnus-close-server (gnus-command-method)
286 "Close the connection to GNUS-COMMAND-METHOD."
287 (when (stringp gnus-command-method)
288 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
289 (funcall (gnus-get-function gnus-command-method 'close-server)
290 (nth 1 gnus-command-method)))
292 (defun gnus-request-list (gnus-command-method)
293 "Request the active file from GNUS-COMMAND-METHOD."
294 (when (stringp gnus-command-method)
295 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
296 (funcall (gnus-get-function gnus-command-method 'request-list)
297 (nth 1 gnus-command-method)))
299 (defun gnus-request-list-newsgroups (gnus-command-method)
300 "Request the newsgroups file from GNUS-COMMAND-METHOD."
301 (when (stringp gnus-command-method)
302 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
303 (funcall (gnus-get-function gnus-command-method 'request-list-newsgroups)
304 (nth 1 gnus-command-method)))
306 (defun gnus-request-newgroups (date gnus-command-method)
307 "Request all new groups since DATE from GNUS-COMMAND-METHOD."
308 (when (stringp gnus-command-method)
309 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
310 (let ((func (gnus-get-function gnus-command-method 'request-newgroups t)))
312 (funcall func date (nth 1 gnus-command-method)))))
314 (defun gnus-server-opened (gnus-command-method)
315 "Check whether a connection to GNUS-COMMAND-METHOD has been opened."
316 (unless (eq (gnus-server-status gnus-command-method)
318 (when (stringp gnus-command-method)
319 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
320 (funcall (inline (gnus-get-function gnus-command-method 'server-opened))
321 (nth 1 gnus-command-method))))
323 (defun gnus-status-message (gnus-command-method)
324 "Return the status message from GNUS-COMMAND-METHOD.
325 If GNUS-COMMAND-METHOD is a string, it is interpreted as a group
326 name. The method this group uses will be queried."
327 (let ((gnus-command-method
328 (if (stringp gnus-command-method)
329 (gnus-find-method-for-group gnus-command-method)
330 gnus-command-method)))
331 (funcall (gnus-get-function gnus-command-method 'status-message)
332 (nth 1 gnus-command-method))))
334 (defun gnus-request-regenerate (gnus-command-method)
335 "Request a data generation from GNUS-COMMAND-METHOD."
336 (when (stringp gnus-command-method)
337 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
338 (funcall (gnus-get-function gnus-command-method 'request-regenerate)
339 (nth 1 gnus-command-method)))
341 (defun gnus-request-group (group &optional dont-check gnus-command-method)
342 "Request GROUP. If DONT-CHECK, no information is required."
343 (let ((gnus-command-method
344 (or gnus-command-method (inline (gnus-find-method-for-group group)))))
345 (when (stringp gnus-command-method)
346 (setq gnus-command-method
347 (inline (gnus-server-to-method gnus-command-method))))
348 (funcall (inline (gnus-get-function gnus-command-method 'request-group))
349 (gnus-group-real-name group) (nth 1 gnus-command-method)
352 (defun gnus-list-active-group (group)
353 "Request active information on GROUP."
354 (let ((gnus-command-method (gnus-find-method-for-group group))
355 (func 'list-active-group))
356 (when (gnus-check-backend-function func group)
357 (funcall (gnus-get-function gnus-command-method func)
358 (gnus-group-real-name group) (nth 1 gnus-command-method)))))
360 (defun gnus-request-group-description (group)
361 "Request a description of GROUP."
362 (let ((gnus-command-method (gnus-find-method-for-group group))
363 (func 'request-group-description))
364 (when (gnus-check-backend-function func group)
365 (funcall (gnus-get-function gnus-command-method func)
366 (gnus-group-real-name group) (nth 1 gnus-command-method)))))
368 (defun gnus-request-group-articles (group)
369 "Request a list of existing articles in GROUP."
370 (let ((gnus-command-method (gnus-find-method-for-group group))
371 (func 'request-group-articles))
372 (when (gnus-check-backend-function func group)
373 (funcall (gnus-get-function gnus-command-method func)
374 (gnus-group-real-name group) (nth 1 gnus-command-method)))))
376 (defun gnus-close-group (group)
377 "Request the GROUP be closed."
378 (let ((gnus-command-method (inline (gnus-find-method-for-group group))))
379 (funcall (gnus-get-function gnus-command-method 'close-group)
380 (gnus-group-real-name group) (nth 1 gnus-command-method))))
382 (defun gnus-retrieve-headers (articles group &optional fetch-old)
383 "Request headers for ARTICLES in GROUP.
384 If FETCH-OLD, retrieve all headers (or some subset thereof) in the group."
385 (let ((gnus-command-method (gnus-find-method-for-group group)))
387 ((and gnus-use-cache (numberp (car articles)))
388 (gnus-cache-retrieve-headers articles group fetch-old))
389 ((and gnus-agent (gnus-online gnus-command-method)
390 (gnus-agent-method-p gnus-command-method))
391 (gnus-agent-retrieve-headers articles group fetch-old))
393 (funcall (gnus-get-function gnus-command-method 'retrieve-headers)
394 articles (gnus-group-real-name group)
395 (nth 1 gnus-command-method) fetch-old)))))
397 (defun gnus-retrieve-articles (articles group)
398 "Request ARTICLES in GROUP."
399 (let ((gnus-command-method (gnus-find-method-for-group group)))
400 (funcall (gnus-get-function gnus-command-method 'retrieve-articles)
401 articles (gnus-group-real-name group)
402 (nth 1 gnus-command-method))))
404 (defun gnus-retrieve-groups (groups gnus-command-method)
405 "Request active information on GROUPS from GNUS-COMMAND-METHOD."
406 (when (stringp gnus-command-method)
407 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
408 (funcall (gnus-get-function gnus-command-method 'retrieve-groups)
409 groups (nth 1 gnus-command-method)))
411 (defun gnus-request-type (group &optional article)
412 "Return the type (`post' or `mail') of GROUP (and ARTICLE)."
413 (let ((gnus-command-method (gnus-find-method-for-group group)))
414 (if (not (gnus-check-backend-function
415 'request-type (car gnus-command-method)))
417 (funcall (gnus-get-function gnus-command-method 'request-type)
418 (gnus-group-real-name group) article))))
420 (defun gnus-request-set-mark (group action)
421 "Set marks on articles in the back end."
422 (let* ((gnus-command-method (gnus-find-method-for-group group))
423 (gnus-plugged (or gnus-plugged
424 (member (car gnus-command-method)
425 gnus-servers-that-use-local-marks))))
426 (if (not (gnus-check-backend-function
427 'request-set-mark (car gnus-command-method)))
429 (funcall (gnus-get-function gnus-command-method 'request-set-mark)
430 (gnus-group-real-name group) action
431 (nth 1 gnus-command-method)))))
433 (defun gnus-request-update-mark (group article mark)
434 "Allow the back end to change the mark the user tries to put on an article."
435 (let* ((gnus-command-method (gnus-find-method-for-group group))
436 (gnus-plugged (or gnus-plugged
437 (member (car gnus-command-method)
438 gnus-servers-that-use-local-marks))))
439 (if (not (gnus-check-backend-function
440 'request-update-mark (car gnus-command-method)))
442 (funcall (gnus-get-function gnus-command-method 'request-update-mark)
443 (gnus-group-real-name group) article mark))))
445 (defun gnus-request-article (article group &optional buffer)
446 "Request the ARTICLE in GROUP.
447 ARTICLE can either be an article number or an article Message-ID.
448 If BUFFER, insert the article in that group."
449 (let ((gnus-command-method (gnus-find-method-for-group group)))
450 (funcall (gnus-get-function gnus-command-method 'request-article)
451 article (gnus-group-real-name group)
452 (nth 1 gnus-command-method) buffer)))
454 (defun gnus-request-head (article group)
455 "Request the head of ARTICLE in GROUP."
456 (let* ((gnus-command-method (gnus-find-method-for-group group))
457 (head (gnus-get-function gnus-command-method 'request-head t))
463 (gnus-cache-request-article article group))
464 (setq res (cons group article)
466 ;; Check the agent cache.
467 ((gnus-agent-request-article article group)
468 (setq res (cons group article)
470 ;; Use `head' function.
472 (setq res (funcall head article (gnus-group-real-name group)
473 (nth 1 gnus-command-method))))
474 ;; Use `article' function.
476 (setq res (gnus-request-article article group)
480 (set-buffer nntp-server-buffer)
481 (goto-char (point-min))
482 (when (search-forward "\n\n" nil t)
483 (delete-region (1- (point)) (point-max)))
484 (nnheader-fold-continuation-lines)))
487 (defun gnus-request-body (article group)
488 "Request the body of ARTICLE in GROUP."
489 (let* ((gnus-command-method (gnus-find-method-for-group group))
490 (head (gnus-get-function gnus-command-method 'request-body t))
496 (gnus-cache-request-article article group))
497 (setq res (cons group article)
499 ;; Check the agent cache.
500 ((gnus-agent-request-article article group)
501 (setq res (cons group article)
503 ;; Use `head' function.
505 (setq res (funcall head article (gnus-group-real-name group)
506 (nth 1 gnus-command-method))))
507 ;; Use `article' function.
509 (setq res (gnus-request-article article group)
513 (set-buffer nntp-server-buffer)
514 (goto-char (point-min))
515 (when (search-forward "\n\n" nil t)
516 (delete-region (point-min) (1- (point))))))
519 (defun gnus-request-post (gnus-command-method)
520 "Post the current buffer using GNUS-COMMAND-METHOD."
521 (when (stringp gnus-command-method)
522 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
523 (funcall (gnus-get-function gnus-command-method 'request-post)
524 (nth 1 gnus-command-method)))
526 (defun gnus-request-scan (group gnus-command-method)
527 "Request a SCAN being performed in GROUP from GNUS-COMMAND-METHOD.
528 If GROUP is nil, all groups on GNUS-COMMAND-METHOD are scanned."
529 (let ((gnus-command-method
530 (if group (gnus-find-method-for-group group) gnus-command-method))
531 (gnus-inhibit-demon t)
532 (mail-source-plugged gnus-plugged))
533 (when (or gnus-plugged (not (gnus-agent-method-p gnus-command-method)))
534 (setq gnus-internal-registry-spool-current-method gnus-command-method)
535 (funcall (gnus-get-function gnus-command-method 'request-scan)
536 (and group (gnus-group-real-name group))
537 (nth 1 gnus-command-method)))))
539 (defsubst gnus-request-update-info (info gnus-command-method)
540 "Request that GNUS-COMMAND-METHOD update INFO."
541 (when (stringp gnus-command-method)
542 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
543 (when (gnus-check-backend-function
544 'request-update-info (car gnus-command-method))
545 (let ((group (gnus-info-group info)))
546 (and (funcall (gnus-get-function gnus-command-method
547 'request-update-info)
548 (gnus-group-real-name group)
549 info (nth 1 gnus-command-method))
550 ;; If the minimum article number is greater than 1, then all
551 ;; smaller article numbers are known not to exist; we'll
552 ;; artificially add those to the 'read range.
553 (let* ((active (gnus-active group))
556 (let* ((range (if (= min 2) 1 (cons 1 (1- min))))
557 (read (gnus-info-read info))
558 (new-read (gnus-range-add read (list range))))
559 (gnus-info-set-read info new-read)))
562 (defun gnus-request-expire-articles (articles group &optional force)
563 (let* ((gnus-command-method (gnus-find-method-for-group group))
566 (gnus-get-function gnus-command-method 'request-expire-articles)
567 articles (gnus-group-real-name group) (nth 1 gnus-command-method)
569 (when (and gnus-agent
570 (gnus-agent-method-p gnus-command-method))
571 (let ((expired-articles (gnus-sorted-difference articles not-deleted)))
572 (when expired-articles
573 (gnus-agent-expire expired-articles group 'force))))
576 (defun gnus-request-move-article (article group server accept-function
578 (let* ((gnus-command-method (gnus-find-method-for-group group))
579 (result (funcall (gnus-get-function gnus-command-method
580 'request-move-article)
581 article (gnus-group-real-name group)
582 (nth 1 gnus-command-method) accept-function last)))
583 (when (and result gnus-agent
584 (gnus-agent-method-p gnus-command-method))
585 (gnus-agent-unfetch-articles group (list article)))
588 (defun gnus-request-accept-article (group &optional gnus-command-method last
590 ;; Make sure there's a newline at the end of the article.
591 (when (stringp gnus-command-method)
592 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
593 (when (and (not gnus-command-method)
595 (setq gnus-command-method (or (gnus-find-method-for-group group)
596 (gnus-group-name-to-method group))))
597 (goto-char (point-max))
601 (let ((message-options message-options))
602 (message-options-set-recipient)
604 (message-narrow-to-head)
605 (let ((mail-parse-charset message-default-charset))
606 (mail-encode-encoded-word-buffer)))
607 (message-encode-message-body)))
608 (let ((gnus-command-method (or gnus-command-method
609 (gnus-find-method-for-group group)))
612 (gnus-get-function gnus-command-method 'request-accept-article)
613 (if (stringp group) (gnus-group-real-name group) group)
614 (cadr gnus-command-method)
616 (when (and gnus-agent (gnus-agent-method-p gnus-command-method))
617 (gnus-agent-regenerate-group group (list (cdr result))))
620 (defun gnus-request-replace-article (article group buffer &optional no-encode)
622 (let ((message-options message-options))
623 (message-options-set-recipient)
625 (message-narrow-to-head)
626 (let ((mail-parse-charset message-default-charset))
627 (mail-encode-encoded-word-buffer)))
628 (message-encode-message-body)))
629 (let* ((func (car (gnus-group-name-to-method group)))
630 (result (funcall (intern (format "%s-request-replace-article" func))
631 article (gnus-group-real-name group) buffer)))
632 (when (and gnus-agent (gnus-agent-method-p gnus-command-method))
633 (gnus-agent-regenerate-group group (list article)))
636 (defun gnus-request-associate-buffer (group)
637 (let ((gnus-command-method (gnus-find-method-for-group group)))
638 (funcall (gnus-get-function gnus-command-method 'request-associate-buffer)
639 (gnus-group-real-name group))))
641 (defun gnus-request-restore-buffer (article group)
642 "Request a new buffer restored to the state of ARTICLE."
643 (let ((gnus-command-method (gnus-find-method-for-group group)))
644 (funcall (gnus-get-function gnus-command-method 'request-restore-buffer)
645 article (gnus-group-real-name group)
646 (nth 1 gnus-command-method))))
648 (defun gnus-request-create-group (group &optional gnus-command-method args)
649 (when (stringp gnus-command-method)
650 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
651 (let ((gnus-command-method
652 (or gnus-command-method (gnus-find-method-for-group group))))
653 (funcall (gnus-get-function gnus-command-method 'request-create-group)
654 (gnus-group-real-name group) (nth 1 gnus-command-method) args)))
656 (defun gnus-request-delete-group (group &optional force)
657 (let* ((gnus-command-method (gnus-find-method-for-group group))
659 (funcall (gnus-get-function gnus-command-method 'request-delete-group)
660 (gnus-group-real-name group) force (nth 1 gnus-command-method))))
662 (gnus-cache-delete-group group)
663 (gnus-agent-delete-group group))
666 (defun gnus-request-rename-group (group new-name)
667 (let* ((gnus-command-method (gnus-find-method-for-group group))
669 (funcall (gnus-get-function gnus-command-method 'request-rename-group)
670 (gnus-group-real-name group)
671 (gnus-group-real-name new-name) (nth 1 gnus-command-method))))
673 (gnus-cache-rename-group group new-name)
674 (gnus-agent-rename-group group new-name))
677 (defun gnus-close-backends ()
678 ;; Send a close request to all backends that support such a request.
679 (let ((methods gnus-valid-select-methods)
680 (gnus-inhibit-demon t)
681 func gnus-command-method)
682 (while (setq gnus-command-method (pop methods))
683 (when (fboundp (setq func (intern
684 (concat (car gnus-command-method)
688 (defun gnus-asynchronous-p (gnus-command-method)
689 (let ((func (gnus-get-function gnus-command-method 'asynchronous-p t)))
693 (defun gnus-remove-denial (gnus-command-method)
694 (when (stringp gnus-command-method)
695 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
696 (let* ((elem (assoc gnus-command-method gnus-opened-servers))
697 (status (cadr elem)))
698 ;; If this hasn't been opened before, we add it to the list.
699 (when (eq status 'denied)
700 ;; Set the status of this server.
701 (setcar (cdr elem) 'closed))))
705 ;;; arch-tag: bbc90087-9b7f-4017-a92c-3abf180ac86d
706 ;;; gnus-int.el ends here