Function: nntp-possibly-change-group

nntp-possibly-change-group is a byte-compiled function defined in nntp.el.gz.

Signature

(nntp-possibly-change-group GROUP SERVER &optional CONNECTIONLESS)

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/nntp.el.gz
(defun nntp-possibly-change-group (group server &optional connectionless)
  (let ((nnheader-callback-function nil))
    (when server
      (or (nntp-server-opened server)
	  (nntp-open-server server nil connectionless)))

    (unless connectionless
      (or (nntp-find-connection nntp-server-buffer)
	  (nntp-open-connection nntp-server-buffer))))

  (when group
    (let ((entry (nntp-find-connection-entry nntp-server-buffer)))
      (cond ((not entry)
             (nntp-report "NNTP server %S closed connection" nntp-address))
            ((not (equal group (caddr entry)))
             (with-current-buffer (process-buffer (car entry))
               (erase-buffer)
               (nntp-send-command "^[245].*\n" "GROUP" group)
               (setcar (cddr entry) group)
               (erase-buffer)
	       (nntp-erase-buffer nntp-server-buffer)))))))