From: yamaoka Date: Mon, 31 Mar 2003 23:52:18 +0000 (+0000) Subject: Synch to Oort Gnus 200303312021. X-Git-Tag: t-gnus-6_15_19-00-quimby~23 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=7e6506f766df1526b0db781d80508bdfe07d054d;p=elisp%2Fgnus.git- Synch to Oort Gnus 200303312021. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a42eb75..6b14dac 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,16 @@ +2003-03-31 Reiner Steib + + * 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 * gnus.el (gnus-version-number): Bump. diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index e14d2e6..db3a67e 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -49,6 +49,8 @@ (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) @@ -6075,13 +6077,7 @@ after replacing with the original article." :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) @@ -6151,12 +6147,12 @@ must return `mid', `mail', `invalid' or `ask'." (-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]") ;; @@ -6302,6 +6298,9 @@ address, `ask' if unsure and `invalid' if the string is invalid." (defvar gnus-button-handle-describe-prefix "^\\(C-h\\|?\\)") +;; 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 @@ -6314,6 +6313,15 @@ address, `ask' if unsure and `invalid' if the string is invalid." (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 @@ -6344,6 +6352,15 @@ address, `ask' if unsure and `invalid' if the string is invalid." (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 @@ -6385,36 +6402,53 @@ probably a good idea. See Info node `(gnus)Group Parameters' and the variable :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) - ("\\( \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) + ("\\( \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\\|?\\)[ \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 @@ -6427,37 +6461,51 @@ positives are possible." 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\\|?\\)[ \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\\|?\\)[ \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\\|?\\)[ \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\\|?\\)[ \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... - ("]*\\)>" 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)... + ("]*\\)>" + 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 @@ -6482,16 +6530,21 @@ variable it the real callback function." (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 @@ -6880,17 +6933,27 @@ specified by `gnus-button-alist'." "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." diff --git a/texi/ChangeLog b/texi/ChangeLog index b0e3b77..f1e8217 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,3 +1,8 @@ +2003-03-31 Reiner Steib + + * gnus.texi (Article Button Levels): New node. + (Article Buttons): Additions. + 2003-03-31 Lars Magne Ingebrigtsen * gnus.texi (Exiting Gnus): Removed gnus-unload. diff --git a/texi/gnus-ja.texi b/texi/gnus-ja.texi index 533ba6f..374a830 100644 --- a/texi/gnus-ja.texi +++ b/texi/gnus-ja.texi @@ -695,6 +695,7 @@ Article Treatment * Article Header:: $B%X%C%@!<$r$$$m$$$mJQ7A$5$;$k(B * Article Buttons:: URL $B$d(B Message-ID $B$d%"%I%l%9$J$I$r%/%j%C(B $B%/$9$k(B +* Article Button Levels:: $B%\%?%s$N8+$(J}$r@)8f$9$k(B * Article Date:: $B$0$:$0$:8@$&$J!"@$3&;~$@(B! * Article Display:: X-Face, Picons, Smileys $B$rI=<($9$k(B * Article Signature:: $B=pL>$C$F2?(B? @@ -7761,6 +7762,7 @@ Gnus $B$O%U%!%$%k$r1\Mw$9$k$N$r7hDj$9$k$N$K(B@dfn{$B5,B'JQ?t(B}$B$rMQ$$$^$9 * Article Header:: $B%X%C%@!<$r$$$m$$$mJQ7A$5$;$k(B * Article Buttons:: URL $B$d(B Message-ID $B$d%"%I%l%9$J$I$r%/%j%C(B $B%/$9$k(B +* Article Button Levels:: $B%\%?%s$N8+$(J}$r@)8f$9$k(B * Article Date:: $B$0$:$0$:8@$&$J!"@$3&;~$@(B! * Article Display:: X-Face, Picons, Smileys $B$rI=<($9$k(B * Article Signature:: $B=pL>$C$F2?(B? @@ -8437,9 +8439,10 @@ html2text ($B%7%s%W%k$J(B @sc{html} $B%3%s%P!<%?!H$K(B@dfn{$B%\%?%s(B}$B$rIU$1$^$9(B: $B$A$c$s$H(B -$B$7$?(B URL$B!"%a!<%k%"%I%l%9!"(BMessage-ID$B!"(BInfo $B$X$N%j%s%/!"$=$l$K(B man $B%Z!<%8(B -$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$$!"(B -$B$b$&0l$D$O5-;v$N%X%C%@!<$r07$$$^$9!#(B +$B$7$?(B URL$B!"%a!<%k%"%I%l%9!"(BMessage-ID$B!"(BInfo $B$X$N%j%s%/!"(Bman $B%Z!<%8!"$=$l(B +$B$K4XO"$9$k(B Emacs $B$^$?$O(B Gnus $B$N;29MJ88%$G$9!#$3$l$OFs$D$NJQ?t$K$h$C$F@)(B +$B8f$5$l$F$$$F!"$=$N0l$D$O5-;v$NK\BN$r07$$!"$b$&0l$D$O5-;v$N%X%C%@!<$r07$$(B +$B$^$9!#(B @table @code @item gnus-button-alist @@ -8455,7 +8458,8 @@ Gnus $B$O%G%#%U%)%k%H$GFCDj$NI8=`$N;2>H$K(B@dfn{$B%\%?%s(B}$B$rIU$1$^$9(B: $B$3$N@55,I=8=(B ($BBgJ8;z$H>.J8;z$O6hJL$5$l$J$$(B) $B$K9gCW$9$k$9$Y$F$NJ8$O30It;2(B $B>H$G$"$k$H$_$J$5$l$^$9!#$3$l$OKd$a9~$^$l$?(B URL $B$K9gCW$9$kE57?E*$J@55,I=(B $B8=$G$9(B @samp{]*\\)>}$B!#$3$l$O$^$?@55,I=8=$NCM$r;}$DJQ?t$G(B -$B$"$C$F$b$h$/!"M-MQ$JJQ?t$H$7$F(B @code{gnus-button-url-regexp} $B$,$"$j$^$9!#(B +$B$"$C$F$b$h$/!"M-MQ$JJQ?t$H$7$F(B @code{gnus-button-url-regexp} $B$*$h(B +$B$S(B @code{gnus-button-mid-or-mail-regexp} $B$,$"$j$^$9!#(B @item button-par Gnus $B$O9gCW$7$?$b$N$N$I$NItJ,$,%O%$%i%$%H$5$l$k$N$+$rCN$i$J$1$l$P$J$j$^(B @@ -8465,7 +8469,10 @@ Gnus $B$O9gCW$7$?$b$N$N$I$NItJ,$,%O%$%i%$%H$5$l$k$N$+$rCN$i$J$1$l$P$J$j$^(B @item use-p $B$3$N<0$O(B @code{$BI>2A(B} $B$5$l!"7k2L$,(B @code{nil} $B$G$J$1$l$P!"$3$l$O9gCW$G$"(B $B$k$H$_$J$5$l$^$9!#$3$l$O4V0c$C$?9gCW$rHr$1$k$?$a$KFCJL$JA*JL$r$7$?$$$H$-(B -$B$KLr$KN)$A$^$9!#(B +$B$KLr$KN)$A$^$9!#$3$3$G$O$7$P$7$P(B @code{gnus-button-@var{*}-level} $B$N$h$&(B +$B$JL>A0$NJQ?t$,;H$o$l$^$9$,!"B>$N$I$s$J7A<0$G$b;H$&$3$H$,$G$-$^$9!#(B + +@c @code{use-p} is @code{eval}ed only if @code{regexp} matches. @item function $B$3$N4X?t(B (function) $B$O$3$N%\%?%s$r%/%j%C%/$7$?$H$-$K8F$P$l$^$9!#(B @@ -8493,11 +8500,71 @@ Gnus $B$O9gCW$7$?$b$N$N$I$NItJ,$,%O%$%i%$%H$5$l$k$N$+$rCN$i$J$1$l$P$J$j$^(B @var{header} $B$O@55,I=8=$G$9!#(B +@subsubheading $B4XO"$9$kJQ?t$H4X?t(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 $BKd$a9~$^$l$?(B URL $B$K9gCW$9$k@55,I=8=$G$9!#$=$l$O>e$NJQ?t$N%G%#%U%)%k%H$N(B $BCM$G;H$o$l$^$9!#(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 $B%\%?%s$K;H$o$l$k%U%'%$%9$G$9!#(B @@ -8510,6 +8577,73 @@ Gnus $B$O9gCW$7$?$b$N$N$I$NItJ,$,%O%$%i%$%H$5$l$k$N$+$rCN$i$J$1$l$P$J$j$^(B $B5-;v$r<+F0E*$K%\%?%s2=$9$kJ}K!$O(B @xref{Customizing Articles} $B$r;2>H$7$F(B $B2<$5$$!#(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)) + ("\\" (gnus-button-man-level 10)) + ("\\" (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 $B5-;v$NF|IU(B diff --git a/texi/gnus.texi b/texi/gnus.texi index a4104d8..a8aeeeb 100644 --- a/texi/gnus.texi +++ b/texi/gnus.texi @@ -615,6 +615,7 @@ Article Treatment * 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? @@ -7902,6 +7903,7 @@ these articles easier. * 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? @@ -8602,9 +8604,9 @@ button on these references. @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 @@ -8623,7 +8625,7 @@ All text that match this regular expression (case insensitive) will be considered an external reference. Here's a typical regexp that matches embedded URLs: @samp{]*\\)>}. 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 @@ -8633,7 +8635,11 @@ highlighted. If you want it all highlighted, you use 0 here. @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. @@ -8662,11 +8668,70 @@ used to say what headers to apply the buttonize coding to: @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. @@ -8680,6 +8745,73 @@ Face used when the mouse cursor is over a button. @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)) + ("\\" (gnus-button-man-level 10)) + ("\\" (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