+2003-03-31 Reiner Steib <Reiner.Steib@gmx.de>
+
+ * gnus-art.el (gnus-button-valid-fqdn-regexp): Use
+ `message-valid-fqdn-regexp' for initialization.
+ (gnus-button-handle-info-url): Renamed and extended version of
+ `gnus-button-handle-info'.
+ (gnus-button-message-level): Renamed from `gnus-button-mail-level'
+ (gnus-button-handle-symbol, gnus-button-handle-library)
+ (gnus-button-handle-info-keystrokes): New functions.
+ (gnus-button-browse-level): New variable.
+ (gnus-button-alist): Use them. Added levels.
+ (gnus-header-button-alist): Added levels.
+
2003-03-31 Lars Magne Ingebrigtsen <larsi@gnus.org>
* gnus.el (gnus-version-number): Bump.
(require 'mm-view)
(require 'mm-uu))
+(require 'message)
+
(autoload 'gnus-msg-mail "gnus-msg" nil t)
(autoload 'gnus-button-mailto "gnus-msg")
(autoload 'gnus-button-reply "gnus-msg" nil t)
:type 'regexp)
(defcustom gnus-button-valid-fqdn-regexp
- (concat "[a-z0-9][-.a-z0-9]+\\." ;; [hostname.subdomain.]domain.
- ;; valid TLDs:
- "\\([a-z][a-z]" ;; two letter country TDLs
- "\\|biz\\|com\\|edu\\|gov\\|int\\|mil\\|net\\|org"
- "\\|aero\\|coop\\|info\\|name\\|museum"
- "\\|arpa\\|pro\\|uucp\\|bitnet\\|bofh" ;; old style?
- "\\)")
+ message-valid-fqdn-regexp
"Regular expression that matches a valid FQDN."
:group 'gnus-article-buttons
:type 'regexp)
(-5.0 . "@[Nn][Ee][Ww][Ss]") ;; /\@news/i
(-5.0 . "@.*[Dd][Ii][Aa][Ll][Uu][Pp]") ;; /\@.*dialup/i;
(-1.0 . "^[^a-z]+@")
-
+ ;;
(-5.0 . "\\.[0-9][0-9]+.*@") ;; "\.[0-9]{2,}.*\@"
(-5.0 . "[a-z].*[A-Z].*[a-z].*[A-Z].*@") ;; "([a-z].*[A-Z].*){2,}\@"
(-3.0 . "[A-Z][A-Z][a-z][a-z].*@")
(-5.0 . "\\...?.?@") ;; (-5.0 . "\..{1,3}\@")
-
+ ;;
(-2.0 . "^[0-9]")
(-1.0 . "^[0-9][0-9]")
;;
(defvar gnus-button-handle-describe-prefix "^\\(C-h\\|<?[Ff]1>?\\)")
+;; FIXME: Maybe we should merge some of the functions that do quite similar
+;; stuff?
+
(defun gnus-button-handle-describe-function (url)
"Call `describe-function' when pushing the corresponding URL button."
(describe-function
(intern
(gnus-replace-in-string url gnus-button-handle-describe-prefix ""))))
+(defun gnus-button-handle-symbol (url)
+"Display help on variable or function.
+Calls `describe-variable' or `describe-function'."
+ (let ((sym (intern url)))
+ (cond
+ ((fboundp sym) (describe-function sym))
+ ((boundp sym) (describe-variable sym))
+ (t (gnus-message 3 "`%s' is not a known function of variable." url)))))
+
(defun gnus-button-handle-describe-key (url)
"Call `describe-key' when pushing the corresponding URL button."
(let* ((key-string
(if (fboundp 'apropos-documentation) 'apropos-documentation 'apropos)
(gnus-replace-in-string url gnus-button-handle-describe-prefix "")))
+(defun gnus-button-handle-library (url)
+ "Call `locate-library' when pushing the corresponding URL button."
+ (gnus-message 9 "url=`%s'" url)
+ (let* ((lib (locate-library url))
+ (file (gnus-replace-in-string (or lib "") "\.elc" ".el")))
+ (if (not lib)
+ (gnus-message 1 "Cannot locale library `%s'." url)
+ (find-file-read-only file))))
+
(defun gnus-button-handle-ctan (url)
"Call `browse-url' when pushing a CTAN URL button."
(funcall
:link '(custom-manual "(gnus)Group Parameters")
:type 'integer)
-(defcustom gnus-button-mail-level 5
- "*Integer that says how many buttons for message IDs or mail addresses will appear.
+(defcustom gnus-button-message-level 5
+ "*Integer that says how many buttons for news or mail messages will appear.
The higher the number, the more buttons will appear and the more false
positives are possible."
+ ;; mail addresses, MIDs, URLs for news, ...
+ :group 'gnus-article-buttons
+ :type 'integer)
+
+(defcustom gnus-button-browse-level 5
+ "*Integer that says how many buttons for browsing will appear.
+The higher the number, the more buttons will appear and the more false
+positives are possible."
+ ;; stuff handled by `browse-url' or `gnus-button-embedded-url'
:group 'gnus-article-buttons
:type 'integer)
(defcustom gnus-button-alist
'(("<\\(url:[>\n\t ]*?\\)?\\(nntp\\|news\\):[>\n\t ]*\\([^>\n\t ]*@[^>\n\t ]*\\)>"
- 0 t gnus-button-handle-news 3)
+ 0 (>= gnus-button-message-level 0) gnus-button-handle-news 3)
("\\b\\(nntp\\|news\\):\\([^>\n\t ]*@[^>)!;:,\n\t ]*\\)" 0 t
gnus-button-handle-news 2)
("\\(\\b<\\(url:[>\n\t ]*\\)?news:[>\n\t ]*\\(//\\)?\\([^>\n\t ]*\\)>\\)"
- 1 t
- gnus-button-fetch-group 4)
- ("\\bnews:\\(//\\)?\\([^'\">\n\t ]+\\)" 0 t gnus-button-fetch-group 2)
- ("\\bin\\( +article\\| +message\\)? +\\(<\\([^\n @<>]+@[^\n @<>]+\\)>\\)" 2
- t gnus-button-message-id 3)
- ("\\(<URL: *\\)mailto: *\\([^> \n\t]+\\)>" 0 t gnus-url-mailto 2)
- ("mailto:\\([-a-z.@_+0-9%=?]+\\)" 0 t gnus-url-mailto 1)
- ("\\bmailto:\\([^ \n\t]+\\)" 0 t gnus-url-mailto 1)
+ 1 (>= gnus-button-message-level 0) gnus-button-fetch-group 4)
+ ("\\bnews:\\(//\\)?\\([^'\">\n\t ]+\\)"
+ 0 (>= gnus-button-message-level 0) gnus-button-fetch-group 2)
+ ("\\bin\\( +article\\| +message\\)? +\\(<\\([^\n @<>]+@[^\n @<>]+\\)>\\)"
+ 2 (>= gnus-button-message-level 0) gnus-button-message-id 3)
+ ("\\(<URL: *\\)mailto: *\\([^> \n\t]+\\)>"
+ 0 (>= gnus-button-message-level 0) gnus-url-mailto 2)
+ ("mailto:\\([-a-z.@_+0-9%=?]+\\)"
+ 0 (>= gnus-button-message-level 0) gnus-url-mailto 1)
+ ("\\bmailto:\\([^ \n\t]+\\)"
+ 0 (>= gnus-button-message-level 0) gnus-url-mailto 1)
;; CTAN
- ("\\bCTAN:[ \t\n]*\\([^>)!;:,\n\t ]*\\)" 0 (>= gnus-button-tex-level 1)
- gnus-button-handle-ctan 1)
+ ("\\bCTAN:[ \t\n]*\\([^>)!;:,\n\t ]*\\)"
+ 0 (>= gnus-button-tex-level 1) gnus-button-handle-ctan 1)
;; This is info
- ("\\binfo:\\(//\\)?\\([^'\">\n\t ]+\\)" 0
- (>= gnus-button-emacs-level 1) gnus-button-handle-info 2)
+ ("\\binfo:\\(//\\)?\\([^'\">\n\t ]+\\)"
+ 0 (>= gnus-button-emacs-level 1) gnus-button-handle-info-url 2)
+ ("\\((Info-goto-node\\|(info\\)[ \t\n]*\\(\"[^\"]*\"\\))" 0
+ (>= gnus-button-emacs-level 1) gnus-button-handle-info-url 2)
+ ("\\b\\(C-h\\|<?[Ff]1>?\\)[ \t\n]+i[ \t\n]+d?[ \t\n]?m[ \t\n]+\\([^ ]+ ?[^ ]+\\)[ \t\n]+RET"
+ ;; Info links like `C-h i d m CC Mode RET'
+ 0 (>= gnus-button-emacs-level 1) gnus-button-handle-info-keystrokes 2)
;; This is custom
- ("\\bcustom:\\(//\\)?\\([^'\">\n\t ]+\\)" 0
- (>= gnus-button-emacs-level 5) gnus-button-handle-custom 2)
+ ("\\bcustom:\\(//\\)?\\([^'\">\n\t ]+\\)"
+ 0 (>= gnus-button-emacs-level 5) gnus-button-handle-custom 2)
("M-x[ \t\n]customize-[^ ]+[ \t\n]RET[ \t\n]\\([^ ]+\\)[ \t\n]RET" 0
(>= gnus-button-emacs-level 1) gnus-button-handle-custom 1)
;; Emacs help commands
0 (>= gnus-button-emacs-level 1) gnus-button-handle-apropos-variable 1)
("M-x[ \t\n]+apropos-documentation[ \t\n]+RET[ \t\n]+\\([^ \t\n]+\\)[ \t\n]+RET"
0 (>= gnus-button-emacs-level 1) gnus-button-handle-apropos-documentation 1)
+ ;; The following entries may lead to many false positives so don't enable
+ ;; them by default (use a high button level):
+ ("/\\([a-z][-a-z0-9]+\\.el\\)\\>"
+ 1 (>= gnus-button-emacs-level 8) gnus-button-handle-library 1)
+ ("`\\([a-z][-a-z0-9]+\\.el\\)'"
+ 1 (>= gnus-button-emacs-level 8) gnus-button-handle-library 1)
+ ("`\\([a-z]+-[a-z]+-[-a-z]+\\|\\(gnus\\|message\\)-[-a-z]+\\)'"
+ 0 (>= gnus-button-emacs-level 8) gnus-button-handle-symbol 1)
+ ("`\\([a-z]+-[a-z]+\\)'"
+ 0 (>= gnus-button-emacs-level 9) gnus-button-handle-symbol 1)
("\\b\\(C-h\\|<?[Ff]1>?\\)[ \t\n]+f[ \t\n]+\\([^ \t\n]+\\)[ \t\n]+RET"
0 (>= gnus-button-emacs-level 1) gnus-button-handle-describe-function 2)
("\\b\\(C-h\\|<?[Ff]1>?\\)[ \t\n]+v[ \t\n]+\\([^ \t\n]+\\)[ \t\n]+RET"
0 (>= gnus-button-emacs-level 1) gnus-button-handle-describe-variable 2)
- ("`\\(\\b\\(C-h\\|<?[Ff]1>?\\)[ \t\n]+k[ \t\n]+\\([^']+\\)\\)'" 1
+ ("[ \t\n(]setq[ \t\n]+\\([^ \t\n]+\\)[ \t\n)]+"
+ 1 (>= gnus-button-emacs-level 1) gnus-button-handle-describe-variable 1)
+ ("`\\(\\b\\(C-h\\|<?[Ff]1>?\\)[ \t\n]+k[ \t\n]+\\([^']+\\)\\)'"
;; Unlike the other regexps we really have to require quoting
;; here to determine where it ends.
- (>= gnus-button-emacs-level 1) gnus-button-handle-describe-key 3)
- ;; This is how URLs _should_ be embedded in text...
- ("<URL: *\\([^<>]*\\)>" 1 t gnus-button-embedded-url 1)
+ 1 (>= gnus-button-emacs-level 1) gnus-button-handle-describe-key 3)
+ ;; This is how URLs _should_ be embedded in text (RFC 1738)...
+ ("<URL: *\\([^<>]*\\)>"
+ 1 (>= gnus-button-browse-level 0) gnus-button-embedded-url 1)
;; Raw URLs.
- (gnus-button-url-regexp 0 t browse-url 0)
+ (gnus-button-url-regexp
+ 0 (>= gnus-button-browse-level 0) browse-url 0)
;; man pages
- ("\\b\\([a-z][a-z]+\\)([1-9])\\W" 0
- (and (>= gnus-button-man-level 1) (< gnus-button-man-level 3))
+ ("\\b\\([a-z][a-z]+\\)([1-9])\\W"
+ 0 (and (>= gnus-button-man-level 1) (< gnus-button-man-level 3))
gnus-button-handle-man 1)
;; more man pages: resolv.conf(5), iso_8859-1(7), xterm(1x)
- ("\\b\\([a-z][-_.a-z0-9]+\\)([1-9])\\W" 0
- (and (>= gnus-button-man-level 3) (< gnus-button-man-level 5))
+ ("\\b\\([a-z][-_.a-z0-9]+\\)([1-9])\\W"
+ 0 (and (>= gnus-button-man-level 3) (< gnus-button-man-level 5))
gnus-button-handle-man 1)
;; even more: Apache::PerlRun(3pm), PDL::IO::FastRaw(3pm),
- ;; SoWWWAnchor(3iv), XSelectInput(3X11)
- ("\\b\\([a-z][-_.:a-z0-9]+\\)([1-9][X1a-z]*)\\W" 0
- (>= gnus-button-man-level 5) gnus-button-handle-man 1)
+ ;; SoWWWAnchor(3iv), XSelectInput(3X11), X(1), X(7)
+ ("\\b\\([a-z][-_.:a-z0-9]+\\)([1-9][X1a-z]*)\\W\\|\\b\\(X\\)([1-9])\\W"
+ 0 (>= gnus-button-man-level 5) gnus-button-handle-man 1)
;; MID or mail: To avoid too many false positives we don't try to catch
;; all kind of allowed MIDs or mail addresses. Domain part must contain
;; at least one dot. TLD must contain two or three chars or be a know TLD
;; (info|name|...). Put this entry near the _end_ of `gnus-button-alist'
;; so that non-ambiguous entries (see above) match first.
(gnus-button-mid-or-mail-regexp
- 0 (>= gnus-button-mail-level 5) gnus-button-handle-mid-or-mail 1))
+ 0 (>= gnus-button-message-level 5) gnus-button-handle-mid-or-mail 1))
"*Alist of regexps matching buttons in article bodies.
Each entry has the form (REGEXP BUTTON FORM CALLBACK PAR...), where
(defcustom gnus-header-button-alist
'(("^\\(References\\|Message-I[Dd]\\):" "<[^<>]+>"
- 0 t gnus-button-message-id 0)
- ("^\\(From\\|Reply-To\\):" ": *\\(.+\\)$" 1 t gnus-button-reply 1)
+ 0 (>= gnus-button-message-level 0) gnus-button-message-id 0)
+ ("^\\(From\\|Reply-To\\):" ": *\\(.+\\)$"
+ 1 (>= gnus-button-message-level 0) gnus-button-reply 1)
("^\\(Cc\\|To\\):" "[^ \t\n<>,()\"]+@[^ \t\n<>,()\"]+"
- 0 t gnus-button-mailto 0)
- ("^X-[Uu][Rr][Ll]:" gnus-button-url-regexp 0 t browse-url 0)
- ("^Subject:" gnus-button-url-regexp 0 t browse-url 0)
- ("^[^:]+:" gnus-button-url-regexp 0 t browse-url 0)
- ("^[^:]+:" "\\bmailto:\\([-a-z.@_+0-9%=?]+\\)" 0 t gnus-url-mailto 1)
- ("^[^:]+:" "\\(<\\(url: \\)?news:\\([^>\n ]*\\)>\\)" 1 t
- gnus-button-message-id 3))
+ 0 (>= gnus-button-message-level 0) gnus-button-mailto 0)
+ ("^X-[Uu][Rr][Ll]:" gnus-button-url-regexp
+ 0 (>= gnus-button-browse-level 0) browse-url 0)
+ ("^Subject:" gnus-button-url-regexp
+ 0 (>= gnus-button-browse-level 0) browse-url 0)
+ ("^[^:]+:" gnus-button-url-regexp
+ 0 (>= gnus-button-browse-level 0) browse-url 0)
+ ("^[^:]+:" "\\bmailto:\\([-a-z.@_+0-9%=?]+\\)"
+ 0 (>= gnus-button-message-level 0) gnus-url-mailto 1)
+ ("^[^:]+:" "\\(<\\(url: \\)?news:\\([^>\n ]*\\)>\\)"
+ 1 (>= gnus-button-message-level 0) gnus-button-message-id 3))
"*Alist of headers and regexps to match buttons in article heads.
This alist is very similar to `gnus-button-alist', except that each
"Fetch a man page."
(funcall gnus-button-man-handler url))
-(defun gnus-button-handle-info (url)
+(defun gnus-button-handle-info-url (url)
"Fetch an info URL."
- (if (string-match
- "^\\([^:/]+\\)?/\\(.*\\)"
- url)
- (gnus-info-find-node
- (concat "(" (or (gnus-url-unhex-string (match-string 1 url))
- "Gnus")
- ")"
- (gnus-url-unhex-string (match-string 2 url))))
- (error "Can't parse %s" url)))
+ (cond
+ ((string-match "^\\([^:/]+\\)?/\\(.*\\)" url)
+ (gnus-info-find-node
+ (concat "(" (or (gnus-url-unhex-string (match-string 1 url))
+ "Gnus")
+ ")" (gnus-url-unhex-string (match-string 2 url)))))
+ ((string-match "([^)\"]+)[^\"]+" url)
+ (setq url
+ (gnus-replace-in-string
+ (gnus-replace-in-string url "[\n\t ]+" " ") "\"" ""))
+ (gnus-info-find-node url))
+ (t (error "Can't parse %s" url))))
+
+(defun gnus-button-handle-info-keystrokes (url)
+ "Call `info' when pushing the corresponding URL button."
+ ;; For links like `C-h i d m gnus RET', `C-h i d m CC Mode RET'.
+ (info)
+ (Info-directory)
+ (Info-menu url))
(defun gnus-button-message-id (message-id)
"Fetch MESSAGE-ID."
+2003-03-31 Reiner Steib <Reiner.Steib@gmx.de>
+
+ * gnus.texi (Article Button Levels): New node.
+ (Article Buttons): Additions.
+
2003-03-31 Lars Magne Ingebrigtsen <larsi@gnus.org>
* gnus.texi (Exiting Gnus): Removed gnus-unload.
* Article Header:: \e$B%X%C%@!<$r$$$m$$$mJQ7A$5$;$k\e(B
* Article Buttons:: URL \e$B$d\e(B Message-ID \e$B$d%"%I%l%9$J$I$r%/%j%C\e(B
\e$B%/$9$k\e(B
+* Article Button Levels:: \e$B%\%?%s$N8+$(J}$r@)8f$9$k\e(B
* Article Date:: \e$B$0$:$0$:8@$&$J!"@$3&;~$@\e(B!
* Article Display:: X-Face, Picons, Smileys \e$B$rI=<($9$k\e(B
* Article Signature:: \e$B=pL>$C$F2?\e(B?
* Article Header:: \e$B%X%C%@!<$r$$$m$$$mJQ7A$5$;$k\e(B
* Article Buttons:: URL \e$B$d\e(B Message-ID \e$B$d%"%I%l%9$J$I$r%/%j%C\e(B
\e$B%/$9$k\e(B
+* Article Button Levels:: \e$B%\%?%s$N8+$(J}$r@)8f$9$k\e(B
* Article Date:: \e$B$0$:$0$:8@$&$J!"@$3&;~$@\e(B!
* Article Display:: X-Face, Picons, Smileys \e$B$rI=<($9$k\e(B
* Article Signature:: \e$B=pL>$C$F2?\e(B?
@vindex gnus-button-man-handler
Gnus \e$B$O%G%#%U%)%k%H$GFCDj$NI8=`$N;2>H$K\e(B@dfn{\e$B%\%?%s\e(B}\e$B$rIU$1$^$9\e(B: \e$B$A$c$s$H\e(B
-\e$B$7$?\e(B URL\e$B!"%a!<%k%"%I%l%9!"\e(BMessage-ID\e$B!"\e(BInfo \e$B$X$N%j%s%/!"$=$l$K\e(B man \e$B%Z!<%8\e(B
-\e$B$G$9!#$3$l$OFs$D$NJQ?t$K$h$C$F@)8f$5$l$F$$$F!"$=$N0l$D$O5-;v$NK\BN$r07$$!"\e(B
-\e$B$b$&0l$D$O5-;v$N%X%C%@!<$r07$$$^$9!#\e(B
+\e$B$7$?\e(B URL\e$B!"%a!<%k%"%I%l%9!"\e(BMessage-ID\e$B!"\e(BInfo \e$B$X$N%j%s%/!"\e(Bman \e$B%Z!<%8!"$=$l\e(B
+\e$B$K4XO"$9$k\e(B Emacs \e$B$^$?$O\e(B Gnus \e$B$N;29MJ88%$G$9!#$3$l$OFs$D$NJQ?t$K$h$C$F@)\e(B
+\e$B8f$5$l$F$$$F!"$=$N0l$D$O5-;v$NK\BN$r07$$!"$b$&0l$D$O5-;v$N%X%C%@!<$r07$$\e(B
+\e$B$^$9!#\e(B
@table @code
@item gnus-button-alist
\e$B$3$N@55,I=8=\e(B (\e$BBgJ8;z$H>.J8;z$O6hJL$5$l$J$$\e(B) \e$B$K9gCW$9$k$9$Y$F$NJ8$O30It;2\e(B
\e$B>H$G$"$k$H$_$J$5$l$^$9!#$3$l$OKd$a9~$^$l$?\e(B URL \e$B$K9gCW$9$kE57?E*$J@55,I=\e(B
\e$B8=$G$9\e(B @samp{<URL:\\([^\n\r>]*\\)>}\e$B!#$3$l$O$^$?@55,I=8=$NCM$r;}$DJQ?t$G\e(B
-\e$B$"$C$F$b$h$/!"M-MQ$JJQ?t$H$7$F\e(B @code{gnus-button-url-regexp} \e$B$,$"$j$^$9!#\e(B
+\e$B$"$C$F$b$h$/!"M-MQ$JJQ?t$H$7$F\e(B @code{gnus-button-url-regexp} \e$B$*$h\e(B
+\e$B$S\e(B @code{gnus-button-mid-or-mail-regexp} \e$B$,$"$j$^$9!#\e(B
@item button-par
Gnus \e$B$O9gCW$7$?$b$N$N$I$NItJ,$,%O%$%i%$%H$5$l$k$N$+$rCN$i$J$1$l$P$J$j$^\e(B
@item use-p
\e$B$3$N<0$O\e(B @code{\e$BI>2A\e(B} \e$B$5$l!"7k2L$,\e(B @code{nil} \e$B$G$J$1$l$P!"$3$l$O9gCW$G$"\e(B
\e$B$k$H$_$J$5$l$^$9!#$3$l$O4V0c$C$?9gCW$rHr$1$k$?$a$KFCJL$JA*JL$r$7$?$$$H$-\e(B
-\e$B$KLr$KN)$A$^$9!#\e(B
+\e$B$KLr$KN)$A$^$9!#$3$3$G$O$7$P$7$P\e(B @code{gnus-button-@var{*}-level} \e$B$N$h$&\e(B
+\e$B$JL>A0$NJQ?t$,;H$o$l$^$9$,!"B>$N$I$s$J7A<0$G$b;H$&$3$H$,$G$-$^$9!#\e(B
+
+@c @code{use-p} is @code{eval}ed only if @code{regexp} matches.
@item function
\e$B$3$N4X?t\e(B (function) \e$B$O$3$N%\%?%s$r%/%j%C%/$7$?$H$-$K8F$P$l$^$9!#\e(B
@var{header} \e$B$O@55,I=8=$G$9!#\e(B
+@subsubheading \e$B4XO"$9$kJQ?t$H4X?t\e(B
+
+@item gnus-button-@var{*}-level
+@xref{Article Button Levels}.
+
+@c Stuff related to gnus-button-browse-level
+
@item gnus-button-url-regexp
@vindex gnus-button-url-regexp
\e$BKd$a9~$^$l$?\e(B URL \e$B$K9gCW$9$k@55,I=8=$G$9!#$=$l$O>e$NJQ?t$N%G%#%U%)%k%H$N\e(B
\e$BCM$G;H$o$l$^$9!#\e(B
+@c TRANSLATEME
+@c Stuff related to gnus-button-man-level
+
+@item gnus-button-man-handler
+@vindex gnus-button-man-handler
+The function to use for displaying man pages. It must take at least one
+argument with a string naming the man page.
+
+@c Stuff related to gnus-button-message-level
+
+@item gnus-button-mid-or-mail-regexp
+@vindex gnus-button-mid-or-mail-regexp
+Regular expression that matches a message ID or a mail address.
+
+@item gnus-button-prefer-mid-or-mail
+@vindex gnus-button-prefer-mid-or-mail
+This variable determines what to do when the button on a string as
+@samp{foo123@@bar.invalid} is pushed. Strings like this can be either a
+message ID or a mail address. If it is one of the symbols @code{mid} or
+@code{mail}, Gnus will always assume that the string is a message ID or
+a mail address, respectivly. If this variable is set to the symbol
+@code{ask}, always query the user what do do. If it is a function, this
+function will be called with the string as it's only argument. The
+function must return @code{mid}, @code{mail}, @code{invalid} or
+@code{ask}. The default value is the function
+@code{gnus-button-mid-or-mail-heuristic}.
+
+@item gnus-button-mid-or-mail-heuristic
+@findex gnus-button-mid-or-mail-heuristic
+Function that guesses whether it's argument is a message ID or a mail
+address. Returns @code{mid} it's a message IDs, @code{mail} if it's a
+mail address, @code{ask} if unsure and @code{invalid} if the string is
+invalid.
+
+@item gnus-button-mid-or-mail-heuristic-alist
+@vindex gnus-button-mid-or-mail-heuristic-alist
+An alist of @code{(RATE . REGEXP)} pairs used by the function
+@code{gnus-button-mid-or-mail-heuristic}.
+
+@c Stuff related to gnus-button-tex-level
+
+@item gnus-button-ctan-handler
+@findex gnus-button-ctan-handler
+The function to use for displaying CTAN links. It must take one
+argument, the string naming the URL.
+
+@item gnus-ctan-url
+@vindex gnus-ctan-url
+Top directory of a CTAN (Comprehensive TeX Archive Network) archive used
+by @code{gnus-button-ctan-handler}.
+
+@c Misc stuff
+
@item gnus-article-button-face
@vindex gnus-article-button-face
\e$B%\%?%s$K;H$o$l$k%U%'%$%9$G$9!#\e(B
\e$B5-;v$r<+F0E*$K%\%?%s2=$9$kJ}K!$O\e(B @xref{Customizing Articles} \e$B$r;2>H$7$F\e(B
\e$B2<$5$$!#\e(B
+@c TRANSLATEME
+@node Article Button Levels
+@subsection Article button levels
+@cindex button levels
+The higher the value of the variables @code{gnus-button-@var{*}-level},
+the more buttons will appear. If the level is zero, no corresponding
+buttons are displayed. With the default value (which is 5) you should
+already see quite a lot of buttons. With higher levels, you will see
+more buttons, but you may also get more false positives. To avoid them,
+you can set the variables @code{gnus-button-@var{*}-level} local to
+specific groups (@pxref{Group Parameters}). Here's an example for the
+variable @code{gnus-parameters}:
+
+@lisp
+;; increase `gnus-button-*-level' in some groups:
+(setq gnus-parameters
+ '(("\\<\\(emacs\\|gnus\\)\\>" (gnus-button-emacs-level 10))
+ ("\\<unix\\>" (gnus-button-man-level 10))
+ ("\\<tex\\>" (gnus-button-tex-level 10))))
+@end lisp
+
+@table @code
+
+@item gnus-button-browse-level
+@vindex gnus-button-browse-level
+Controls the display of references to message IDs, mail addresses and
+news URLs. Related variables and functions include
+@code{gnus-button-url-regexp}, @code{browse-url}, and
+@code{browse-url-browser-function}.
+
+@item gnus-button-emacs-level
+@vindex gnus-button-emacs-level
+Controls the display of Emacs or Gnus references. Related functions are
+@code{gnus-button-handle-custom},
+@code{gnus-button-handle-describe-function},
+@code{gnus-button-handle-describe-variable},
+@code{gnus-button-handle-symbol},
+@code{gnus-button-handle-describe-key},
+@code{gnus-button-handle-apropos},
+@code{gnus-button-handle-apropos-command},
+@code{gnus-button-handle-apropos-variable},
+@code{gnus-button-handle-apropos-documentation}, and
+@code{gnus-button-handle-library}.
+
+@item gnus-button-man-level
+@vindex gnus-button-man-level
+Controls the display of references to (Unix) man pages.
+See @code{gnus-button-man-handler}.
+
+@item gnus-button-message-level
+@vindex gnus-button-message-level
+Controls the display of message IDs, mail addresses and news URLs.
+Related variables and functions include
+@code{gnus-button-mid-or-mail-regexp},
+@code{gnus-button-prefer-mid-or-mail},
+@code{gnus-button-mid-or-mail-heuristic}, and
+@code{gnus-button-mid-or-mail-heuristic-alist}.
+
+@item gnus-button-tex-level
+@vindex gnus-button-tex-level
+Controls the display of references to TeX or LaTeX stuff, e.g. for CTAN
+URLs. See the variables @code{gnus-ctan-url},
+@code{gnus-button-ctan-handler} and
+@code{gnus-button-handle-ctan-bogus-regexp}.
+
+@end table
+
@node Article Date
@subsection \e$B5-;v$NF|IU\e(B
* Article Washing:: Lots of way-neat functions to make life better.
* Article Header:: Doing various header transformations.
* Article Buttons:: Click on URLs, Message-IDs, addresses and the like.
+* Article Button Levels:: Controlling appearance of buttons.
* Article Date:: Grumble, UT!
* Article Display:: Display various stuff---X-Face, Picons, Smileys
* Article Signature:: What is a signature?
* Article Washing:: Lots of way-neat functions to make life better.
* Article Header:: Doing various header transformations.
* Article Buttons:: Click on URLs, Message-IDs, addresses and the like.
+* Article Button Levels:: Controlling appearance of buttons.
* Article Date:: Grumble, UT!
* Article Display:: Display various stuff---X-Face, Picons, Smileys
* Article Signature:: What is a signature?
@vindex gnus-button-man-handler
Gnus adds @dfn{buttons} to certain standard references by default:
-Well-formed URLs, mail addresses, Message-IDs, Info links and man pages.
-This is controlled by two variables, one that handles article bodies and
-one that handles article heads:
+Well-formed URLs, mail addresses, Message-IDs, Info links, man pages and
+Emacs or Gnus related references. This is controlled by two variables,
+one that handles article bodies and one that handles article heads:
@table @code
considered an external reference. Here's a typical regexp that matches
embedded URLs: @samp{<URL:\\([^\n\r>]*\\)>}. This can also be a
variable containing a regexp, useful variables to use include
-@code{gnus-button-url-regexp}.
+@code{gnus-button-url-regexp} and @code{gnus-button-mid-or-mail-regexp}.
@item button-par
Gnus has to know which parts of the matches is to be highlighted. This
@item use-p
This form will be @code{eval}ed, and if the result is non-@code{nil},
this is considered a match. This is useful if you want extra sifting to
-avoid false matches.
+avoid false matches. Often variables named
+@code{gnus-button-@var{*}-level} are used here, @xref{Article Button
+Levels}, but any other form may be used too.
+
+@c @code{use-p} is @code{eval}ed only if @code{regexp} matches.
@item function
This function will be called when you click on this button.
@var{header} is a regular expression.
+@subsubheading Related variables and functions
+
+@item gnus-button-@var{*}-level
+@xref{Article Button Levels}.
+
+@c Stuff related to gnus-button-browse-level
+
@item gnus-button-url-regexp
@vindex gnus-button-url-regexp
A regular expression that matches embedded URLs. It is used in the
default values of the variables above.
+@c Stuff related to gnus-button-man-level
+
+@item gnus-button-man-handler
+@vindex gnus-button-man-handler
+The function to use for displaying man pages. It must take at least one
+argument with a string naming the man page.
+
+@c Stuff related to gnus-button-message-level
+
+@item gnus-button-mid-or-mail-regexp
+@vindex gnus-button-mid-or-mail-regexp
+Regular expression that matches a message ID or a mail address.
+
+@item gnus-button-prefer-mid-or-mail
+@vindex gnus-button-prefer-mid-or-mail
+This variable determines what to do when the button on a string as
+@samp{foo123@@bar.invalid} is pushed. Strings like this can be either a
+message ID or a mail address. If it is one of the symbols @code{mid} or
+@code{mail}, Gnus will always assume that the string is a message ID or
+a mail address, respectivly. If this variable is set to the symbol
+@code{ask}, always query the user what do do. If it is a function, this
+function will be called with the string as it's only argument. The
+function must return @code{mid}, @code{mail}, @code{invalid} or
+@code{ask}. The default value is the function
+@code{gnus-button-mid-or-mail-heuristic}.
+
+@item gnus-button-mid-or-mail-heuristic
+@findex gnus-button-mid-or-mail-heuristic
+Function that guesses whether it's argument is a message ID or a mail
+address. Returns @code{mid} it's a message IDs, @code{mail} if it's a
+mail address, @code{ask} if unsure and @code{invalid} if the string is
+invalid.
+
+@item gnus-button-mid-or-mail-heuristic-alist
+@vindex gnus-button-mid-or-mail-heuristic-alist
+An alist of @code{(RATE . REGEXP)} pairs used by the function
+@code{gnus-button-mid-or-mail-heuristic}.
+
+@c Stuff related to gnus-button-tex-level
+
+@item gnus-button-ctan-handler
+@findex gnus-button-ctan-handler
+The function to use for displaying CTAN links. It must take one
+argument, the string naming the URL.
+
+@item gnus-ctan-url
+@vindex gnus-ctan-url
+Top directory of a CTAN (Comprehensive TeX Archive Network) archive used
+by @code{gnus-button-ctan-handler}.
+
+@c Misc stuff
+
@item gnus-article-button-face
@vindex gnus-article-button-face
Face used on buttons.
@xref{Customizing Articles}, for how to buttonize articles automatically.
+@node Article Button Levels
+@subsection Article button levels
+@cindex button levels
+The higher the value of the variables @code{gnus-button-@var{*}-level},
+the more buttons will appear. If the level is zero, no corresponding
+buttons are displayed. With the default value (which is 5) you should
+already see quite a lot of buttons. With higher levels, you will see
+more buttons, but you may also get more false positives. To avoid them,
+you can set the variables @code{gnus-button-@var{*}-level} local to
+specific groups (@pxref{Group Parameters}). Here's an example for the
+variable @code{gnus-parameters}:
+
+@lisp
+;; increase `gnus-button-*-level' in some groups:
+(setq gnus-parameters
+ '(("\\<\\(emacs\\|gnus\\)\\>" (gnus-button-emacs-level 10))
+ ("\\<unix\\>" (gnus-button-man-level 10))
+ ("\\<tex\\>" (gnus-button-tex-level 10))))
+@end lisp
+
+@table @code
+
+@item gnus-button-browse-level
+@vindex gnus-button-browse-level
+Controls the display of references to message IDs, mail addresses and
+news URLs. Related variables and functions include
+@code{gnus-button-url-regexp}, @code{browse-url}, and
+@code{browse-url-browser-function}.
+
+@item gnus-button-emacs-level
+@vindex gnus-button-emacs-level
+Controls the display of Emacs or Gnus references. Related functions are
+@code{gnus-button-handle-custom},
+@code{gnus-button-handle-describe-function},
+@code{gnus-button-handle-describe-variable},
+@code{gnus-button-handle-symbol},
+@code{gnus-button-handle-describe-key},
+@code{gnus-button-handle-apropos},
+@code{gnus-button-handle-apropos-command},
+@code{gnus-button-handle-apropos-variable},
+@code{gnus-button-handle-apropos-documentation}, and
+@code{gnus-button-handle-library}.
+
+@item gnus-button-man-level
+@vindex gnus-button-man-level
+Controls the display of references to (Unix) man pages.
+See @code{gnus-button-man-handler}.
+
+@item gnus-button-message-level
+@vindex gnus-button-message-level
+Controls the display of message IDs, mail addresses and news URLs.
+Related variables and functions include
+@code{gnus-button-mid-or-mail-regexp},
+@code{gnus-button-prefer-mid-or-mail},
+@code{gnus-button-mid-or-mail-heuristic}, and
+@code{gnus-button-mid-or-mail-heuristic-alist}.
+
+@item gnus-button-tex-level
+@vindex gnus-button-tex-level
+Controls the display of references to TeX or LaTeX stuff, e.g. for CTAN
+URLs. See the variables @code{gnus-ctan-url},
+@code{gnus-button-ctan-handler} and
+@code{gnus-button-handle-ctan-bogus-regexp}.
+
+@end table
+
+
@node Article Date
@subsection Article Date