+2007-04-24 Didier Verna <didier@xemacs.org>
+
+ Improve the type of gnus-ignored-from-addresses.
+ * gnus-util.el (gnus-orify-regexp): New function.
+ * message.el (gnus-util): Require it.
+ * message.el (message-dont-reply-to-names): Use gnus-orify-regexp.
+ * gnus-sum.el (gnus-ignored-from-addresses): New function.
+ * gnus-sum.el (gnus-summary-from-or-to-or-newsgroups): Use it.
+
2007-04-24 Didier Verna <didier@xemacs.org>
* gnus-sum.el:
(and user-mail-address
(not (string= user-mail-address ""))
(regexp-quote user-mail-address))
- "*Regexp of From headers that may be suppressed in favor of To headers."
+ "*From headers that may be suppressed in favor of To headers.
+This can be a regexp or a list of regexps."
:version "21.1"
:group 'gnus-summary
- :type 'regexp)
+ :type '(choice regexp
+ (repeat :tag "Regexp List" regexp)))
+
+(defsubst gnus-ignored-from-addresses ()
+ (gnus-orify-regexp gnus-ignored-from-addresses))
(defcustom gnus-summary-to-prefix "-> "
"*String prefixed to the To field in the summary line when
(defun gnus-summary-from-or-to-or-newsgroups (header gnus-tmp-from)
(let ((mail-parse-charset gnus-newsgroup-charset)
+ (ignored-from-addresses (gnus-ignored-from-addresses))
; Is it really necessary to do this next part for each summary line?
; Luckily, doesn't seem to slow things down much.
(mail-parse-ignored-charsets
(with-current-buffer gnus-summary-buffer
gnus-newsgroup-ignored-charsets)))
(or
- (and gnus-ignored-from-addresses
- (string-match gnus-ignored-from-addresses gnus-tmp-from)
+ (and ignored-from-addresses
+ (string-match ignored-from-addresses gnus-tmp-from)
(let ((extra-headers (mail-header-extra header))
to
newsgroups)
((fboundp 'replace-in-string)
(defalias 'gnus-replace-in-string 'replace-in-string))))
+(defun gnus-orify-regexp (regexp)
+ "Potentially convert a list of regexps into a single one."
+ (cond ((null regexp)
+ nil)
+ ((stringp regexp)
+ regexp)
+ ((listp regexp)
+ (mapconcat (lambda (elt) (concat "\\(" elt "\\)"))
+ regexp
+ "\\|"))))
+
(defun gnus-boundp (variable)
"Return non-nil if VARIABLE is bound and non-nil."
(and (boundp variable)
(require 'mml)
(require 'rfc822)
(require 'ecomplete)
+(require 'gnus-util)
(defgroup message '((user-mail-address custom-variable)
(user-full-name custom-variable))
regexp
(repeat :tag "Regexp List" regexp)))
-;; #### FIXME: this might become a generally usefull function at some point
-;; --dlv.
(defsubst message-dont-reply-to-names ()
- "Potentially convert a list of regexps into a single one."
- (cond ((null message-dont-reply-to-names)
- nil)
- ((stringp message-dont-reply-to-names)
- message-dont-reply-to-names)
- ((listp message-dont-reply-to-names)
- (mapconcat (lambda (elt) (concat "\\(" elt "\\)"))
- message-dont-reply-to-names
- "\\|"))))
+ (gnus-orify-regexp message-dont-reply-to-names))
(defvar message-shoot-gnksa-feet nil
"*A list of GNKSA feet you are allowed to shoot.