X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fgnus-group.el;h=a19ba4d9a435b36bf885d062d7893ebd65e8efb7;hb=d1a9bfb4363aceb094957e8d94cfca73be3e2c13;hp=9ac1620a612324b51511a66155e180003a544b03;hpb=345385dcc35b87d428f52d1640b92394123fe04c;p=gnus diff --git a/lisp/gnus-group.el b/lisp/gnus-group.el index 9ac1620a6..a19ba4d9a 100644 --- a/lisp/gnus-group.el +++ b/lisp/gnus-group.el @@ -1,6 +1,6 @@ ;;; gnus-group.el --- group mode commands for Gnus -;; Copyright (C) 1996-2011 Free Software Foundation, Inc. +;; Copyright (C) 1996-2012 Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen ;; Keywords: news @@ -56,7 +56,7 @@ (autoload 'gnus-group-make-nnir-group "nnir") -(defcustom gnus-no-groups-message "No Gnus is good news" +(defcustom gnus-no-groups-message "No news is good news" "*Message displayed by Gnus when no groups are available." :group 'gnus-start :type 'string) @@ -992,7 +992,7 @@ Setter function for custom variables." 'gnus-group-tool-bar-retro) "Specifies the Gnus group tool bar. -It can be either a list or a symbol refering to a list. See +It can be either a list or a symbol referring to a list. See `gmm-tool-bar-from-list' for the format of the list. The default key map is `gnus-group-mode-map'. @@ -2277,8 +2277,8 @@ confirmation is required." number) "Read GROUP from METHOD as an ephemeral group. If ACTIVATE, request the group first. -If QUIT-CONFIG, use that window configuration when exiting from the -ephemeral group. +If QUIT-CONFIG, use that Gnus window configuration name when +exiting from the ephemeral group. If REQUEST-ONLY, don't actually read the group; just request it. If SELECT-ARTICLES, only select those articles. If PARAMETERS, use those as the group parameters. @@ -2290,15 +2290,23 @@ Return the name of the group if selection was successful." ;; (gnus-read-group "Group name: ") (gnus-group-completing-read) (gnus-read-method "From method"))) - ;; Transform the select method into a unique server. (unless (gnus-alive-p) - (gnus-no-server)) + (nnheader-init-server-buffer) + ;; Necessary because of funky inlining. + (require 'gnus-cache) + (setq gnus-newsrc-hashtb (gnus-make-hashtable))) + ;; Transform the select method into a unique server. (when (stringp method) (setq method (gnus-server-to-method method))) - (setq method - `(,(car method) ,(concat (cadr method) "-ephemeral") - (,(intern (format "%s-address" (car method))) ,(cadr method)) - ,@(cddr method))) + (let ((address-slot + (intern (format "%s-address" (car method))))) + (setq method + (if (assq address-slot (cddr method)) + `(,(car method) ,(concat (cadr method) "-ephemeral") + ,@(cddr method)) + `(,(car method) ,(concat (cadr method) "-ephemeral") + (,address-slot ,(cadr method)) + ,@(cddr method))))) (let ((group (if (gnus-group-foreign-p group) group (gnus-group-prefixed-name (gnus-group-real-name group) method)))) @@ -2307,18 +2315,22 @@ Return the name of the group if selection was successful." `(-1 nil (,group ,gnus-level-default-subscribed nil nil ,method ,(cons - (cond - (quit-config - (cons 'quit-config quit-config)) - ((assq gnus-current-window-configuration - gnus-buffer-configuration) - (cons 'quit-config + (cons 'quit-config + (cond + (quit-config + quit-config) + ((assq gnus-current-window-configuration + gnus-buffer-configuration) (cons gnus-summary-buffer - gnus-current-window-configuration)))) + gnus-current-window-configuration)) + (t + (cons (current-buffer) + (current-window-configuration))))) parameters))) gnus-newsrc-hashtb) (push method gnus-ephemeral-servers) - (set-buffer gnus-group-buffer) + (when (gnus-buffer-live-p gnus-group-buffer) + (set-buffer gnus-group-buffer)) (unless (gnus-check-server method) (error "Unable to contact server: %s" (gnus-status-message method))) (when activate @@ -2376,7 +2388,7 @@ specified by `gnus-gmane-group-download-format'." group start (+ start range))) (write-region (point-min) (point-max) tmpfile) (gnus-group-read-ephemeral-group - (format "%s.start-%s.range-%s" group start range) + (format "nndoc+ephemeral:%s.start-%s.range-%s" group start range) `(nndoc ,tmpfile (nndoc-article-type mbox)))) (delete-file tmpfile))) @@ -2469,7 +2481,8 @@ the bug number, and browsing the URL must return mbox output." "/.*$" "")))) (write-region (point-min) (point-max) tmpfile) (gnus-group-read-ephemeral-group - "gnus-read-ephemeral-bug" + (format "nndoc+ephemeral:bug#%s" + (mapconcat 'number-to-string ids ",")) `(nndoc ,tmpfile (nndoc-article-type mbox)) nil window-conf)) @@ -3638,6 +3651,10 @@ Uses the process/prefix convention." (expirable (if (gnus-group-total-expirable-p group) (cons nil (gnus-list-of-read-articles group)) (assq 'expire (gnus-info-marks info)))) + (articles-to-expire + (gnus-list-range-difference + (gnus-uncompress-sequence (cdr expirable)) + (cdr (assq 'unexist (gnus-info-marks info))))) (expiry-wait (gnus-group-find-parameter group 'expiry-wait)) (nnmail-expiry-target (or (gnus-group-find-parameter group 'expiry-target) @@ -3652,11 +3669,9 @@ Uses the process/prefix convention." ;; parameter. (let ((nnmail-expiry-wait-function nil) (nnmail-expiry-wait expiry-wait)) - (gnus-request-expire-articles - (gnus-uncompress-sequence (cdr expirable)) group)) + (gnus-request-expire-articles articles-to-expire group)) ;; Just expire using the normal expiry values. - (gnus-request-expire-articles - (gnus-uncompress-sequence (cdr expirable)) group)))) + (gnus-request-expire-articles articles-to-expire group)))) (gnus-close-group group)) (gnus-message 6 "Expiring articles in %s...done" (gnus-group-decoded-name group)) @@ -4029,7 +4044,8 @@ otherwise all levels below ARG will be scanned too." (unless gnus-slave (gnus-master-read-slave-newsrc)) - (gnus-get-unread-articles arg nil one-level) + (gnus-get-unread-articles (gnus-group-default-level arg t) + nil one-level) ;; If the user wants it, we scan for new groups. (when (eq gnus-check-new-newsgroups 'always) @@ -4072,10 +4088,7 @@ If DONT-SCAN is non-nil, scan non-activated groups as well." (gnus-agent-save-group-info method (gnus-group-real-name group) active)) (gnus-group-update-group group nil t)) - (if (eq (gnus-server-status (gnus-find-method-for-group group)) - 'denied) - (gnus-error 3 "Server previously determined to be down; not retrying") - (gnus-error 3 "%s error: %s" group (gnus-status-message group))))) + (gnus-error 3 "%s error: %s" group (gnus-status-message group)))) (when beg (goto-char beg)) (when gnus-goto-next-group-when-activating @@ -4440,12 +4453,6 @@ and the second element is the address." (gnus-list-of-unread-articles (car info)))))) (error "No such group: %s" (gnus-info-group info)))))) -(defun gnus-group-set-method-info (group select-method) - (gnus-group-set-info select-method group 'method)) - -(defun gnus-group-set-params-info (group params) - (gnus-group-set-info params group 'params)) - ;; Ad-hoc function for inserting data from a different newsrc.eld ;; file. Use with caution, if at all. (defun gnus-import-other-newsrc-file (file) @@ -4666,6 +4673,8 @@ you the groups that have both dormant articles and cached articles." (setq mark gnus-expirable-mark)) (setq mark (gnus-request-update-mark group article mark)) + (gnus-request-set-mark + group (list (list (list article) 'add '(read)))) (gnus-mark-article-as-read article mark) (setq gnus-newsgroup-active (gnus-active group)) (when active