The following specs are understood:
-%h backend
+%h back end
%n name
%w address
%s status
"(closed)")
((error) "(error)")))))
(gnus-tmp-agent (if (and gnus-agent
- (member method
- gnus-agent-covered-methods))
+ (gnus-agent-method-p method))
" (agent)"
"")))
(beginning-of-line)
(prog1 (1+ (point))
;; Insert the text.
(eval gnus-server-line-format-spec))
- (list 'gnus-server (intern gnus-tmp-name)))))
+ (list 'gnus-server (intern gnus-tmp-name)
+ 'gnus-named-server (intern (gnus-method-to-server method))))))
(defun gnus-enter-server-buffer ()
"Set up the server buffer."
(gnus-server-position-point))
(defun gnus-server-server-name ()
- (let ((server (get-text-property (gnus-point-at-bol) 'gnus-server)))
+ (let ((server (get-text-property (point-at-bol) 'gnus-server)))
+ (and server (symbol-name server))))
+
+(defun gnus-server-named-server ()
+ "Return a server name that matches one of the names returned by
+`gnus-method-to-server'."
+ (let ((server (get-text-property (point-at-bol) 'gnus-named-server)))
(and server (symbol-name server))))
(defalias 'gnus-server-position-point 'gnus-goto-colon)
1 "Couldn't request list: %s" (gnus-status-message method))
nil)
(t
- (save-excursion
- (set-buffer nntp-server-buffer)
+ (with-current-buffer nntp-server-buffer
(let ((cur (current-buffer)))
(goto-char (point-min))
(unless (string= gnus-ignored-newsgroups "")
(delete-matching-lines gnus-ignored-newsgroups))
- (while (not (eobp))
- (ignore-errors
- (push (cons
- (if (eq (char-after) ?\")
- (read cur)
- (let ((p (point)) (name ""))
- (skip-chars-forward "^ \t\\\\")
- (setq name (buffer-substring p (point)))
- (while (eq (char-after) ?\\)
- (setq p (1+ (point)))
- (forward-char 2)
+ ;; We treat NNTP as a special case to avoid problems with
+ ;; garbage group names like `"foo' that appear in some badly
+ ;; managed active files. -jh.
+ (if (eq (car method) 'nntp)
+ (while (not (eobp))
+ (ignore-errors
+ (push (cons
+ (buffer-substring
+ (point)
+ (progn
+ (skip-chars-forward "^ \t")
+ (point)))
+ (let ((last (read cur)))
+ (cons (read cur) last)))
+ groups))
+ (forward-line))
+ (while (not (eobp))
+ (ignore-errors
+ (push (cons
+ (if (eq (char-after) ?\")
+ (read cur)
+ (let ((p (point)) (name ""))
(skip-chars-forward "^ \t\\\\")
- (setq name (concat name (buffer-substring
- p (point)))))
- name))
- (let ((last (read cur)))
- (cons (read cur) last)))
- groups))
- (forward-line))))
+ (setq name (buffer-substring p (point)))
+ (while (eq (char-after) ?\\)
+ (setq p (1+ (point)))
+ (forward-char 2)
+ (skip-chars-forward "^ \t\\\\")
+ (setq name (concat name (buffer-substring
+ p (point)))))
+ name))
+ (let ((last (read cur)))
+ (cons (read cur) last)))
+ groups))
+ (forward-line)))))
(setq groups (sort groups
(lambda (l1 l2)
(string< (car l1) (car l2)))))
(prog1 (1+ (point))
(insert
(format "%c%7d: %s\n"
- (let ((level (gnus-group-level
- (concat prefix (setq name (car group))))))
+ (let ((level
+ (if (string= prefix "")
+ (gnus-group-level (setq name (car group)))
+ (gnus-group-level
+ (concat prefix (setq name (car group)))))))
(cond
((<= level gnus-level-subscribed) ? )
((<= level gnus-level-unsubscribed) ?U)
((= level gnus-level-zombie) ?Z)
(t ?K)))
(max 0 (- (1+ (cddr group)) (cadr group)))
- (decode-coding-string
- name
- (inline (gnus-group-name-charset method name))))))
- (list 'gnus-group name))))
+ ;; Don't decode if name is ASCII
+ (if (and (fboundp 'detect-coding-string)
+ (eq (detect-coding-string name t) 'undecided))
+ name
+ (decode-coding-string
+ name
+ (inline (gnus-group-name-charset method name)))))))
+ (list 'gnus-group name)
+ )))
(switch-to-buffer (current-buffer)))
(goto-char (point-min))
(gnus-group-position-point)
(save-excursion
(beginning-of-line)
(let ((name (get-text-property (point) 'gnus-group)))
- (when (re-search-forward ": \\(.*\\)$" (gnus-point-at-eol) t)
- (concat (gnus-method-to-server-name gnus-browse-current-method) ":"
+ (when (re-search-forward ": \\(.*\\)$" (point-at-eol) t)
+ (concat (gnus-method-to-server-name gnus-browse-current-method) ":"
(or name
(match-string-no-properties 1)))))))
(unless (eq (char-after) ? )
(setq sub t))
(setq group (gnus-browse-group-name))
+ (when (gnus-server-equal gnus-browse-current-method "native")
+ (setq group (gnus-group-real-name group)))
(if sub
(progn
;; Make sure the group has been properly removed before we
gnus-browse-current-method)))
gnus-level-default-subscribed (gnus-group-level group)
(and (car (nth 1 gnus-newsrc-alist))
- (gnus-gethash (car (nth 1 gnus-newsrc-alist))
- gnus-newsrc-hashtb))
+ (gnus-group-entry (car (nth 1 gnus-newsrc-alist))))
t)
(delete-char 1)
(insert ? ))
(gnus-get-function (gnus-server-to-method server)
'request-regenerate)
(error
- (error "This backend doesn't support regeneration")))
+ (error "This back end doesn't support regeneration")))
(gnus-message 5 "Requesting regeneration of %s..." server)
(unless (gnus-open-server server)
(error "Couldn't open server"))