;;; gnus.el --- a newsreader for GNU Emacs
;; Copyright (C) 1987, 1988, 1989, 1990, 1993, 1994, 1995, 1996, 1997,
-;; 1998, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+;; 1998, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
;; Lars Magne Ingebrigtsen <larsi@gnus.org>
(require 'wid-edit)
(require 'nnheader)
+(autoload 'message-y-or-n-p "message" nil nil 'macro)
(require 'gnus-vers)
-;; For backward compatibility with old .newsrc.eld files.
-(defvar gnus-tmp-grouplens "")
-
(defgroup gnus nil
"The coffee-brewing, all singing, all dancing, kitchen sink newsreader."
:group 'news
;; These belong to gnus-group.el.
(defgroup gnus-group nil
"Group buffers."
- :link '(custom-manual "(gnus)The Group Buffer")
+ :link '(custom-manual "(gnus)Group Buffer")
:group 'gnus)
(defgroup gnus-group-foreign nil
;; These belong to gnus-sum.el.
(defgroup gnus-summary nil
"Summary buffers."
- :link '(custom-manual "(gnus)The Summary Buffer")
+ :link '(custom-manual "(gnus)Summary Buffer")
:group 'gnus)
(defgroup gnus-summary-exit nil
(defgroup gnus-summary-sort nil
"Sorting the summary buffer."
- :link '(custom-manual "(gnus)Sorting")
+ :link '(custom-manual "(gnus)Sorting the Summary Buffer")
:group 'gnus-summary)
(defgroup gnus-summary-visual nil
(defalias 'gnus-overlay-end 'overlay-end)
(defalias 'gnus-extent-detached-p 'ignore)
(defalias 'gnus-extent-start-open 'ignore)
- (defalias 'gnus-appt-select-lowest-window 'appt-select-lowest-window)
(defalias 'gnus-mail-strip-quoted-names 'mail-strip-quoted-names)
(defalias 'gnus-character-to-event 'identity)
(defalias 'gnus-assq-delete-all 'assq-delete-all)
(defvar gnus-mode-line-image-cache t)
(if (fboundp 'find-image)
(defun gnus-mode-line-buffer-identification (line)
- (let ((str (car-safe line)))
+ (let ((str (car-safe line))
+ (load-path (mm-image-load-path)))
(if (and (stringp str)
(string-match "^Gnus:" str))
(progn (add-text-properties
(display-graphic-p)
(let* ((bg (face-background 'default))
(fg (face-foreground 'gnus-splash-face))
- (data-directory (nnheader-find-etc-directory "gnus"))
+ (data-directory (nnheader-find-etc-directory "images/gnus"))
(image (find-image
`((:type xpm :file "gnus.xpm"
:color-symbols
(\"mail\\\\.me\" (gnus-use-scoring t))
(\"list\\\\..*\" (total-expire . t)
(broken-reply-to . t)))"
+ :version "22.1"
:group 'gnus-group-various
:type '(repeat (cons regexp
(repeat sexp))))
(and (file-readable-p gnus-nntpserver-file)
(with-temp-buffer
(insert-file-contents gnus-nntpserver-file)
- (let ((name (buffer-string)))
- (unless (string-match "\\`[ \t\n]*$" name)
- name))))))
+ (when (re-search-forward "[^ \t\n\r]+" nil t)
+ (match-string 0))))))
(defcustom gnus-select-method
(condition-case nil
(gnus-replace-in-string name "\\." "-") "-charter.html")))
"*An alist of (HIERARCHY . FORM) pairs used to construct the URL of a charter.
When FORM is evaluated `name' is bound to the name of the group."
+ :version "22.1"
:group 'gnus-group-various
:type '(repeat (cons (string :tag "Hierarchy") (sexp :tag "Form"))))
"*Non-nil means that control messages are displayed using `browse-url'.
Otherwise they are fetched with ange-ftp and displayed in an ephemeral
group."
+ :version "22.1"
:group 'gnus-group-various
:type 'boolean)
"Return GROUP's to-address."
:variable-document
"*Alist of group regexps and correspondent to-addresses."
+ :variable-group gnus-group-parameter
:parameter-type '(gnus-email-address :tag "To Address")
:parameter-document "\
This will be used when doing followups and posts.
"Return GROUP's to-list."
:variable-document
"*Alist of group regexps and correspondent to-lists."
+ :variable-group gnus-group-parameter
:parameter-type '(gnus-email-address :tag "To List")
:parameter-document "\
This address will be used when doing a `a' in the group.
"Return GROUP's subscription status."
:variable-document
"*Groups which are automatically considered subscribed."
+ :variable-group gnus-group-parameter
:parameter-type '(const :tag "Subscribed" t)
:parameter-document "\
Gnus assumed that you are subscribed to the To/List address.
"Return GROUP's initial input of the number of articles."
:variable-document
"*Alist of group regexps and its initial input of the number of articles."
+ :variable-group gnus-group-parameter
:parameter-type '(choice :tag "Initial Input for Large Newsgroup"
(const :tag "All" nil)
(integer))
(list
(regexp :tag "Group Name Regular Expression")
(boolean :tag "Ignored")))
-
+
:parameter-type '(boolean :tag "Group Ignored by the Registry")
:parameter-document
"Whether the Gnus Registry should ignore this group.")
(defcustom gnus-install-group-spam-parameters t
"*Disable the group parameters for spam detection.
Enable if `G c' in XEmacs is giving you trouble, and make sure to submit a bug report."
+ :version "22.1"
:type 'boolean
:group 'gnus-start)
:variable gnus-spam-newsgroup-contents
:variable-default nil
:variable-document
- "*Groups in which to automatically mark new articles as spam on
-summary entry. If non-nil, this should be a list of group name
-regexps that should match all groups in which to do automatic spam
-tagging, associated with a classification (spam, ham, or neither).
-This only makes sense for mail groups."
+ "*Group classification (spam, ham, or neither). Only
+meaningful when spam.el is loaded. If non-nil, this should be a
+list of group name regexps associated with a classification for
+each one. In spam groups, new articles are marked as spam on
+summary entry. There is other behavior associated with ham and
+no classification when spam.el is loaded - see the manual."
:variable-group spam
:variable-type '(repeat
(list :tag "Group contents spam/ham classification"
(const :tag "Unclassified" nil)))
:parameter-document
"The spam classification (spam, ham, or neither) of this group.
-When a spam group is entered, all unread articles are marked as spam.")
+When a spam group is entered, all unread articles are marked as
+spam. There is other behavior associated with ham and no
+classification when spam.el is loaded - see the manual.")
+
+ (gnus-define-group-parameter
+ spam-resend-to
+ :type list
+ :function-document
+ "The address to get spam resent (through spam-report-resend)."
+ :variable gnus-spam-resend-to
+ :variable-default nil
+ :variable-document
+ "The address to get spam resent (through spam-report-resend)."
+ :variable-group spam
+ :variable-type '(repeat
+ (list :tag "Group address for resending spam"
+ (regexp :tag "Group")
+ (string :tag "E-mail address for resending spam (requires the spam-use-resend exit processor)")))
+ :parameter-type 'string :tag "E-mail address for resending spam (requires the spam-use-resend exit processor)"
+ :parameter-document
+ "The address to get spam resent (through spam-report-resend).")
+
+ (gnus-define-group-parameter
+ ham-resend-to
+ :type list
+ :function-document
+ "The address to get ham resent (through spam-report-resend)."
+ :variable gnus-ham-resend-to
+ :variable-default nil
+ :variable-document
+ "The address to get ham resent (through spam-report-resend)."
+ :variable-group spam
+ :variable-type '(repeat
+ (list :tag "Group address for resending ham"
+ (regexp :tag "Group")
+ (string :tag "E-mail address for resending ham (requires the spam-use-resend exit processor)")))
+ :parameter-type 'string :tag "E-mail address for resending ham (requires the spam-use-resend exit processor)"
+ :parameter-document
+ "The address to get ham resent (through spam-report-resend).")
(defvar gnus-group-spam-exit-processor-ifile "ifile"
"OBSOLETE: The ifile summary exit spam processor.")
(gnus-define-group-parameter
spam-process
:type list
- :parameter-type
- '(choice
+ :parameter-type
+ '(choice
:tag "Spam Summary Exit Processor"
:value nil
(list :tag "Spam Summary Exit Processor Choices"
(set
+ (const :tag "Spam: Bogofilter" (spam spam-use-bogofilter))
+ (const :tag "Spam: Blacklist" (spam spam-use-blacklist))
+ (const :tag "Spam: Bsfilter" (spam spam-use-bsfilter))
+ (const :tag "Spam: Gmane Report" (spam spam-use-gmane))
+ (const :tag "Spam: Resend Message"(spam spam-use-resend))
+ (const :tag "Spam: ifile" (spam spam-use-ifile))
+ (const :tag "Spam: Spam Oracle" (spam spam-use-spamoracle))
+ (const :tag "Spam: Spam-stat" (spam spam-use-stat))
+ (const :tag "Spam: SpamAssassin" (spam spam-use-spamassassin))
+ (const :tag "Spam: CRM114" (spam spam-use-crm114))
+ (const :tag "Ham: BBDB" (ham spam-use-BBDB))
+ (const :tag "Ham: Bogofilter" (ham spam-use-bogofilter))
+ (const :tag "Ham: Bsfilter" (ham spam-use-bsfilter))
+ (const :tag "Ham: Copy" (ham spam-use-ham-copy))
+ (const :tag "Ham: Resend Message" (ham spam-use-resend))
+ (const :tag "Ham: ifile" (ham spam-use-ifile))
+ (const :tag "Ham: Spam Oracle" (ham spam-use-spamoracle))
+ (const :tag "Ham: Spam-stat" (ham spam-use-stat))
+ (const :tag "Ham: SpamAssassin" (ham spam-use-spamassassin))
+ (const :tag "Ham: CRM114" (ham spam-use-crm114))
+ (const :tag "Ham: Whitelist" (ham spam-use-whitelist))
(variable-item gnus-group-spam-exit-processor-ifile)
(variable-item gnus-group-spam-exit-processor-stat)
(variable-item gnus-group-spam-exit-processor-bogofilter)
(variable-item gnus-group-ham-exit-processor-whitelist)
(variable-item gnus-group-ham-exit-processor-BBDB)
(variable-item gnus-group-ham-exit-processor-spamoracle)
- (variable-item gnus-group-ham-exit-processor-copy)
- (const :tag "Spam: Gmane Report" (spam spam-use-gmane))
- (const :tag "Spam: Bogofilter" (spam spam-use-bogofilter))
- (const :tag "Spam: Blacklist" (spam spam-use-blacklist))
- (const :tag "Spam: ifile" (spam spam-use-ifile))
- (const :tag "Spam: Spam-stat" (spam spam-use-stat))
- (const :tag "Spam: Spam Oracle" (spam spam-use-spamoracle))
- (const :tag "Spam: SpamAssassin" (spam spam-use-spamassassin))
- (const :tag "Ham: SpamAssassin" (ham spam-use-spamassassin))
- (const :tag "Ham: ifile" (ham spam-use-ifile))
- (const :tag "Ham: Bogofilter" (ham spam-use-bogofilter))
- (const :tag "Ham: Spam-stat" (ham spam-use-stat))
- (const :tag "Ham: Whitelist" (ham spam-use-whitelist))
- (const :tag "Ham: BBDB" (ham spam-use-BBDB))
- (const :tag "Ham: Copy" (ham spam-use-ham-copy))
- (const :tag "Ham: Spam Oracle" (ham spam-use-spamoracle)))))
+ (variable-item gnus-group-ham-exit-processor-copy))))
:function-document
"Which spam or ham processors will be applied when the summary is exited."
:variable gnus-spam-process-newsgroups
name regexps that should match all groups in which to do automatic
spam processing, associated with the appropriate processor."
:variable-group spam
- :variable-type
+ :variable-type
'(repeat :tag "Spam/Ham Processors"
(list :tag "Spam Summary Exit Processor Choices"
(regexp :tag "Group Regexp")
- (set
+ (set
:tag "Spam/Ham Summary Exit Processor"
+ (const :tag "Spam: Bogofilter" (spam spam-use-bogofilter))
+ (const :tag "Spam: Blacklist" (spam spam-use-blacklist))
+ (const :tag "Spam: Bsfilter" (spam spam-use-bsfilter))
+ (const :tag "Spam: Gmane Report" (spam spam-use-gmane))
+ (const :tag "Spam: Resend Message"(spam spam-use-resend))
+ (const :tag "Spam: ifile" (spam spam-use-ifile))
+ (const :tag "Spam: Spam-stat" (spam spam-use-stat))
+ (const :tag "Spam: Spam Oracle" (spam spam-use-spamoracle))
+ (const :tag "Spam: SpamAssassin" (spam spam-use-spamassassin))
+ (const :tag "Spam: CRM114" (spam spam-use-crm114))
+ (const :tag "Ham: BBDB" (ham spam-use-BBDB))
+ (const :tag "Ham: Bogofilter" (ham spam-use-bogofilter))
+ (const :tag "Ham: Bsfilter" (ham spam-use-bsfilter))
+ (const :tag "Ham: Copy" (ham spam-use-ham-copy))
+ (const :tag "Ham: Resend Message" (ham spam-use-resend))
+ (const :tag "Ham: ifile" (ham spam-use-ifile))
+ (const :tag "Ham: Spam-stat" (ham spam-use-stat))
+ (const :tag "Ham: Spam Oracle" (ham spam-use-spamoracle))
+ (const :tag "Ham: SpamAssassin" (ham spam-use-spamassassin))
+ (const :tag "Ham: CRM114" (ham spam-use-crm114))
+ (const :tag "Ham: Whitelist" (ham spam-use-whitelist))
(variable-item gnus-group-spam-exit-processor-ifile)
(variable-item gnus-group-spam-exit-processor-stat)
(variable-item gnus-group-spam-exit-processor-bogofilter)
(variable-item gnus-group-ham-exit-processor-whitelist)
(variable-item gnus-group-ham-exit-processor-BBDB)
(variable-item gnus-group-ham-exit-processor-spamoracle)
- (variable-item gnus-group-ham-exit-processor-copy)
- (const :tag "Spam: Gmane Report" (spam spam-use-gmane))
- (const :tag "Spam: Bogofilter" (spam spam-use-bogofilter))
- (const :tag "Spam: Blacklist" (spam spam-use-blacklist))
- (const :tag "Spam: ifile" (spam spam-use-ifile))
- (const :tag "Spam: Spam-stat" (spam spam-use-stat))
- (const :tag "Spam: Spam Oracle" (spam spam-use-spamoracle))
- (const :tag "Spam: SpamAssassin" (spam spam-use-spamassassin))
- (const :tag "Ham: SpamAssassin" (ham spam-use-spamassassin))
- (const :tag "Ham: ifile" (ham spam-use-ifile))
- (const :tag "Ham: Bogofilter" (ham spam-use-bogofilter))
- (const :tag "Ham: Spam-stat" (ham spam-use-stat))
- (const :tag "Ham: Whitelist" (ham spam-use-whitelist))
- (const :tag "Ham: BBDB" (ham spam-use-BBDB))
- (const :tag "Ham: Copy" (ham spam-use-ham-copy))
- (const :tag "Ham: Spam Oracle" (ham spam-use-spamoracle)))))
+ (variable-item gnus-group-ham-exit-processor-copy))))
:parameter-document
"Which spam or ham processors will be applied when the summary is exited.")
(gnus-define-group-parameter
spam-autodetect
:type list
- :parameter-type
+ :parameter-type
'(boolean :tag "Spam autodetection")
:function-document
"Should spam be autodetected (with spam-split) in this group?"
Only unseen articles will be examined, unless
spam-autodetect-recheck-messages is set."
:variable-group spam
- :variable-type
+ :variable-type
'(repeat
:tag "Autodetection setting"
(list
(gnus-define-group-parameter
spam-autodetect-methods
:type list
- :parameter-type
+ :parameter-type
'(choice :tag "Spam autodetection-specific methods"
(const none)
(const default)
(set :tag "Use specific methods"
(variable-item spam-use-blacklist)
+ (variable-item spam-use-gmane-xref)
(variable-item spam-use-regex-headers)
(variable-item spam-use-regex-body)
(variable-item spam-use-whitelist)
(variable-item spam-use-BBDB)
(variable-item spam-use-ifile)
(variable-item spam-use-spamoracle)
+ (variable-item spam-use-crm114)
(variable-item spam-use-spamassassin)
(variable-item spam-use-spamassassin-headers)
+ (variable-item spam-use-bsfilter)
+ (variable-item spam-use-bsfilter-headers)
(variable-item spam-use-stat)
(variable-item spam-use-blackholes)
(variable-item spam-use-hashcash)
will be examined, unless spam-autodetect-recheck-messages is
set."
:variable-group spam
- :variable-type
+ :variable-type
'(repeat
:tag "Autodetection methods"
(list
(const default)
(set :tag "Use specific methods"
(variable-item spam-use-blacklist)
+ (variable-item spam-use-gmane-xref)
(variable-item spam-use-regex-headers)
(variable-item spam-use-regex-body)
(variable-item spam-use-whitelist)
(variable-item spam-use-BBDB)
(variable-item spam-use-ifile)
(variable-item spam-use-spamoracle)
+ (variable-item spam-use-crm114)
(variable-item spam-use-stat)
(variable-item spam-use-blackholes)
(variable-item spam-use-hashcash)
(variable-item spam-use-spamassassin)
(variable-item spam-use-spamassassin-headers)
+ (variable-item spam-use-bsfilter)
+ (variable-item spam-use-bsfilter-headers)
(variable-item spam-use-bogofilter-headers)
(variable-item spam-use-bogofilter)))))
:parameter-document
- "Spam autodetection methods.
+ "Spam autodetection methods.
Requires the spam-autodetect parameter. Only unseen articles
will be examined, unless spam-autodetect-recheck-messages is
set.")
(gnus-define-group-parameter
spam-process-destination
:type list
- :parameter-type
+ :parameter-type
'(choice :tag "Destination for spam-processed articles at summary exit"
(string :tag "Move to a group")
(repeat :tag "Move to multiple groups"
group or nil for explicit expiration. This only makes sense for
mail groups."
:variable-group spam
- :variable-type
+ :variable-type
'(repeat
:tag "Spam-processed articles destination"
(list
(const :tag "Expire" nil))))
:parameter-document
"Where spam-processed articles will go at summary exit.")
-
+
(gnus-define-group-parameter
ham-process-destination
:type list
- :parameter-type
+ :parameter-type
'(choice
:tag "Destination for ham articles at summary exit from a spam group"
(string :tag "Move to a group")
group or nil for explicit ignoring. This only makes sense for
mail groups, and only works in spam groups."
:variable-group spam
- :variable-type
+ :variable-type
'(repeat
:tag "Ham articles destination"
(list
When set, Gnus will prefer using the locally stored content rather
than re-fetching it from the server. You also need to enable
`gnus-agent' for this to have any affect."
- :version "21.3"
+ :version "22.1"
:group 'gnus-agent
:type 'boolean)
You may customize gnus-agent to disable its use. However, some
back ends have started to use the agent as a client-side cache.
Disabling the agent may result in noticeable loss of performance."
- :version "21.3"
+ :version "22.1"
:group 'gnus-agent
:type 'boolean)
(symbol :tag "Parameter")
(sexp :tag "Value")))))
-(defcustom gnus-user-agent 'gnus-mime-edit
+(defcustom gnus-user-agent '(emacs gnus mime config mule)
"Which information should be exposed in the User-Agent header.
-It can be one of the symbols `gnus' \(show only Gnus version\), `emacs-gnus'
-\(show only Emacs and Gnus versions\), `emacs-gnus-config' \(same as
-`emacs-gnus' plus system configuration\), `emacs-gnus-type' \(same as
-`emacs-gnus' plus system type\), `gnus-mime-edit' \(show Gnus version and
-MIME Edit User-Agent\) or a custom string. If you set it to a string,
-be sure to use a valid format, see RFC 2616."
+Can be a list of symbols or a string. Valid symbols are `gnus' (show
+Gnus version), `emacs' (show Emacs version) and `mime' (show SEMI,
+FLIM and APEL versions). In addition to the Emacs version, you can
+add `codename' (show (S)XEmacs codename), `mule' (show Mule version
+and also Meadow version if it exists) or either `config' (show system
+configuration) or `type' (show system type). If you set it to a
+string, be sure to use a valid format, see RFC 2616."
+
+ :version "22.1"
:group 'gnus-message
- :type '(choice
- (item :tag "Show Gnus version and MIME Edit User-Agent"
- gnus-mime-edit)
- (item :tag "Show Gnus and Emacs versions and system type"
- emacs-gnus-type)
- (item :tag "Show Gnus and Emacs versions and system configuration"
- emacs-gnus-config)
- (item :tag "Show Gnus and Emacs versions" emacs-gnus)
- (item :tag "Show only Gnus version" gnus)
- (string :tag "Other")))
+ :type '(choice (list (set :format "%v" :inline t
+ (const gnus :tag "Gnus version")
+ (const emacs :tag "Emacs version")
+ (choice :tag "system"
+ (const type :tag "system type")
+ (const config :tag "system configuration"))
+ (const codename :tag "Emacs codename")
+ (const mime :tag "SEMI and FLIM versions")
+ (const mule
+ :tag "Mule version (and Meadow version)")))
+ (string :format "%t:\n%v")))
+
+;; Convert old (< 2005-01-10) symbol type values:
+(when (symbolp gnus-user-agent)
+ (setq gnus-user-agent
+ (cond ((eq gnus-user-agent 'gnus-mime-edit)
+ '(emacs gnus mime config mule))
+ ((eq gnus-user-agent 'emacs-gnus-config)
+ '(emacs gnus config))
+ ((eq gnus-user-agent 'emacs-gnus-type)
+ '(emacs gnus type))
+ ((eq gnus-user-agent 'emacs-gnus)
+ '(emacs gnus))
+ ((eq gnus-user-agent 'gnus)
+ '(gnus))
+ (t gnus-user-agent)))
+ (gnus-message 1 "Converted `gnus-user-agent' to `%s'." gnus-user-agent)
+ (sit-for 1)
+ (if (get 'gnus-user-agent 'saved-value)
+ (customize-save-variable 'gnus-user-agent gnus-user-agent)
+ (gnus-message 1 "Edit your init file to make this change permanent.")
+ (sit-for 2)))
\f
;;; Internal variables
(defvar gnus-headers-retrieved-by nil)
(defvar gnus-article-reply nil)
(defvar gnus-override-method nil)
-(defvar gnus-article-check-size nil)
(defvar gnus-opened-servers nil)
(defvar gnus-current-kill-article nil)
gnus-uu-decode-uu-and-save-view gnus-uu-decode-unshar-view
gnus-uu-decode-unshar-and-save-view gnus-uu-decode-save-view
gnus-uu-decode-binhex-view gnus-uu-unmark-thread
- gnus-uu-mark-over gnus-uu-post-news)
+ gnus-uu-mark-over gnus-uu-post-news gnus-uu-invert-processable)
("gnus-uu" gnus-uu-delete-work-dir gnus-quote-arg-for-sh-or-csh
gnus-uu-unmark-thread)
("gnus-msg" (gnus-summary-send-map keymap)
gnus-start-date-timer gnus-stop-date-timer)
("gnus-int" gnus-request-type)
("gnus-start" gnus-newsrc-parse-options gnus-1 gnus-no-server-1
- gnus-dribble-enter gnus-read-init-file gnus-dribble-touch)
+ gnus-dribble-enter gnus-read-init-file gnus-dribble-touch
+ gnus-check-reasonable-setup)
("gnus-dup" gnus-dup-suppress-articles gnus-dup-unsuppress-article
gnus-dup-enter-articles)
("gnus-range" gnus-copy-sequence)
(eval-and-compile
(unless (featurep 'xemacs)
- (autoload 'x-face-decode-message-header "x-face-e21")
(autoload 'x-face-mule-gnus-article-display-x-face "x-face-mule")))
(unless (and (fboundp 'base64-encode-string)
%z Article zcore (character)
%t Number of articles under the current thread (number).
%e Whether the thread is empty or not (character).
-%l GroupLens score (string).
%V Total thread score (number).
%P The line number (number).
%O Download mark (character).
(defun gnus-shutdown (symbol)
"Shut down everything that waits for SYMBOL."
- (let ((alist gnus-shutdown-alist)
- entry)
- (while (setq entry (pop alist))
- (when (memq symbol (cdr entry))
- (funcall (car entry))))))
+ (dolist (entry gnus-shutdown-alist)
+ (when (memq symbol (cdr entry))
+ (funcall (car entry)))))
\f
;;;
(nth 1 method))))
method)))
+(defsubst gnus-method-to-server (method)
+ (catch 'server-name
+ (setq method (or method gnus-select-method))
+
+ ;; Perhaps it is already in the cache.
+ (mapc (lambda (name-method)
+ (if (equal (cdr name-method) method)
+ (throw 'server-name (car name-method))))
+ gnus-server-method-cache)
+
+ (mapc
+ (lambda (server-alist)
+ (mapc (lambda (name-method)
+ (when (gnus-methods-equal-p (cdr name-method) method)
+ (unless (member name-method gnus-server-method-cache)
+ (push name-method gnus-server-method-cache))
+ (throw 'server-name (car name-method))))
+ server-alist))
+ (let ((alists (list gnus-server-alist
+ gnus-predefined-server-alist)))
+ (if gnus-select-method
+ (push (list (cons "native" gnus-select-method)) alists))
+ alists))
+
+ (let* ((name (if (member (cadr method) '(nil ""))
+ (format "%s" (car method))
+ (format "%s:%s" (car method) (cadr method))))
+ (name-method (cons name method)))
+ (unless (member name-method gnus-server-method-cache)
+ (push name-method gnus-server-method-cache))
+ name)))
+
(defsubst gnus-server-to-method (server)
"Map virtual server names to select methods."
(or (and server (listp server) server)
;; gnus-server-method-cache so this only happens once,
;; if at all.
(let (match)
- (mapcar
+ (mapcar
(lambda (info)
(let ((info-method (gnus-info-method info)))
(unless (stringp info-method)
(push (cons server result) gnus-server-method-cache))
result)))
-(defsubst gnus-method-to-server (method)
- (catch 'server-name
- (setq method (or method gnus-select-method))
-
- ;; Perhaps it is already in the cache.
- (mapc (lambda (name-method)
- (if (equal (cdr name-method) method)
- (throw 'server-name (car name-method))))
- gnus-server-method-cache)
-
- (mapc
- (lambda (server-alist)
- (mapc (lambda (name-method)
- (when (gnus-methods-equal-p (cdr name-method) method)
- (unless (member name-method gnus-server-method-cache)
- (push name-method gnus-server-method-cache))
- (throw 'server-name (car name-method))))
- server-alist))
- (let ((alists (list gnus-server-alist
- gnus-predefined-server-alist)))
- (if gnus-select-method
- (push (list (cons "native" gnus-select-method)) alists))
- alists))
-
- (let* ((name (if (member (cadr method) '(nil ""))
- (format "%s" (car method))
- (format "%s:%s" (car method) (cadr method))))
- (name-method (cons name method)))
- (unless (member name-method gnus-server-method-cache)
- (push name-method gnus-server-method-cache))
- name)))
-
(defsubst gnus-server-get-method (group method)
;; Input either a server name, and extended server name, or a
;; select method, and return a select method.
(defun gnus-agent-method-p (method)
"Say whether METHOD is covered by the agent."
(or (eq (car gnus-agent-method-p-cache) method)
- (setq gnus-agent-method-p-cache
+ (setq gnus-agent-method-p-cache
(cons method
- (member (if (stringp method)
- method
+ (member (if (stringp method)
+ method
(gnus-method-to-server method)) gnus-agent-covered-methods))))
(cdr gnus-agent-method-p-cache))