Index: gnus-art.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/gnus-art.el,v retrieving revision 6.248 diff -u -r6.248 gnus-art.el --- gnus-art.el 2002/09/27 08:09:05 6.248 +++ gnus-art.el 2002/10/16 18:14:10 @@ -5325,19 +5325,23 @@ (defcustom gnus-button-prefer-mid-or-mail 'guess "What to do when the button on a string as \"foo123@bar.com\" is pushed. -Strings like this can be either a message ID or a mail address. If the -variable is set to the symbol `ask', query the user what do do. If it is the -symbol `guess', Gnus will do a guess and query the user what do do if it is -ambiguous. If it is one of the sybols `mid' or `mail', Gnus will always assume -that the string is a message ID or a mail address, respectivly. See the -variable `gnus-button-guessed-mid-regexp' for details concerning the -guessing." +Strings like this can be either a message ID or a mail address. If +the variable is set to the symbol `ask', query the user what do do. +If it is the symbol `guess', Gnus will do a guess and query the user +what do do if it is ambiguous. See the variable +`gnus-button-guessed-mid-regexp' for details concerning the guessing. +If it is one of the sybols `mid' or `mail', Gnus will always assume +that the string is a message ID or a mail address, respectivly. If it +is a function, Gnus will call this function with the string in +question as the only argument. The function should return non-nil +value, if the argument is supposed to be a message ID." ;; FIXME: doc-string could/should be improved. :group 'gnus-article-buttons :type '(choice (const ask) (const guess) (const mid) - (const mail))) + (const mail) + (function :tag "Iff function evaluates to non-nil"))) (defcustom gnus-button-guessed-mid-regexp (concat @@ -5361,6 +5365,10 @@ ;; otherwise 'ask the user. (if (eq pref 'guess) (if (string-match gnus-button-guessed-mid-regexp mid-or-mail) + (setq pref 'mid) + (setq pref 'ask))) + (if (functionp pref) + (if (funcall pref mid-or-mail) (setq pref 'mid) (setq pref 'ask))) (if (eq pref 'ask)