Variable: erc-button-alist
erc-button-alist is a customizable variable defined in
erc-button.el.gz.
Value
(('nicknames 0 erc-button-buttonize-nicks erc-nick-popup 0)
(erc-button-url-regexp 0 t browse-url-button-open-url 0)
("<URL: *\\([^<> ]+\\) *>" 0 t browse-url-button-open-url 1)
("[`‘]\\([a-zA-Z][-a-zA-Z_0-9!*<=>+]+\\)['’]" 1 t erc-button-describe-symbol 1)
("\\bInfo:[\"]\\([^\"]+\\)[\"]" 0 t Info-goto-node 1)
("\\b\\(Ward\\|Wiki\\|WardsWiki\\|TheWiki\\):\\([A-Z][a-z]+\\([A-Z][a-z]+\\)+\\)" 0 t
(lambda
(page)
(browse-url
(concat "http://c2.com/cgi-bin/wiki?" page)))
2)
("EmacsWiki:\\([A-Z][a-z]+\\([A-Z][a-z]+\\)+\\)" 0 t erc-browse-emacswiki 1)
("Lisp:\\([a-zA-Z.+-]+\\)" 0 t erc-browse-emacswiki-lisp 1)
("\\bGoogle:\\([^ \n
\f]+\\)" 0 t
(lambda
(keywords)
(browse-url
(format erc-button-search-url keywords)))
1)
("\\brfc[#: ]?\\([0-9]+\\)" 0 t
(lambda
(num)
(browse-url
(format erc-button-rfc-url num)))
1)
("\\s-\\(@\\([0-9][0-9][0-9]\\)\\)" 1 t erc-button-beats-to-time 2))
Documentation
Alist of regexps matching buttons in ERC buffers.
Each entry has the form (REGEXP BUTTON FORM CALLBACK PAR...), where
REGEXP is the string matching text around the button or a symbol
indicating a variable holding that string, or a list of
strings, or an alist with the strings in the car. Note that
entries in lists or alists are considered to be nicks or other
complete words. Therefore they are enclosed in \< and \>
while searching. REGEXP can also be the quoted symbol
\='nicknames, which matches the nickname of any user on the
current server.
BUTTON is the number of the regexp grouping actually matching the
button. This is ignored if REGEXP is \='nicknames.
FORM is a Lisp expression which must eval to true for the button to
be added.
CALLBACK is the function to call when the user push this button.
CALLBACK can also be a symbol. Its variable value will be used
as the callback function.
PAR is a number of a regexp grouping whose text will be passed to
CALLBACK. There can be several PAR arguments. If REGEXP is
\='nicknames, these are ignored, and CALLBACK will be called with
the nickname matched as the argument.
This variable was added, or its default value changed, in Emacs 24.1.
Source Code
;; Defined in /usr/src/emacs/lisp/erc/erc-button.el.gz
(defcustom erc-button-alist
;; Since the callback is only executed when the user is clicking on
;; a button, it makes no sense to optimize performance by
;; bytecompiling lambdas in this alist. On the other hand, it makes
;; things hard to maintain.
'(('nicknames 0 erc-button-buttonize-nicks erc-nick-popup 0)
(erc-button-url-regexp 0 t browse-url-button-open-url 0)
("<URL: *\\([^<> ]+\\) *>" 0 t browse-url-button-open-url 1)
;;; ("(\\(\\([^~\n \t@][^\n \t@]*\\)@\\([a-zA-Z0-9.:-]+\\)\\)" 1 t finger 2 3)
;; emacs internal
("[`‘]\\([a-zA-Z][-a-zA-Z_0-9!*<=>+]+\\)['’]"
1 t erc-button-describe-symbol 1)
;; pseudo links
("\\bInfo:[\"]\\([^\"]+\\)[\"]" 0 t Info-goto-node 1)
("\\b\\(Ward\\|Wiki\\|WardsWiki\\|TheWiki\\):\\([A-Z][a-z]+\\([A-Z][a-z]+\\)+\\)"
0 t (lambda (page)
(browse-url (concat "http://c2.com/cgi-bin/wiki?" page)))
2)
("EmacsWiki:\\([A-Z][a-z]+\\([A-Z][a-z]+\\)+\\)" 0 t erc-browse-emacswiki 1)
("Lisp:\\([a-zA-Z.+-]+\\)" 0 t erc-browse-emacswiki-lisp 1)
("\\bGoogle:\\([^ \t\n\r\f]+\\)"
0 t (lambda (keywords)
(browse-url (format erc-button-search-url keywords)))
1)
("\\brfc[#: ]?\\([0-9]+\\)"
0 t (lambda (num)
(browse-url (format erc-button-rfc-url num)))
1)
;; other
("\\s-\\(@\\([0-9][0-9][0-9]\\)\\)" 1 t erc-button-beats-to-time 2))
"Alist of regexps matching buttons in ERC buffers.
Each entry has the form (REGEXP BUTTON FORM CALLBACK PAR...), where
REGEXP is the string matching text around the button or a symbol
indicating a variable holding that string, or a list of
strings, or an alist with the strings in the car. Note that
entries in lists or alists are considered to be nicks or other
complete words. Therefore they are enclosed in \\< and \\>
while searching. REGEXP can also be the quoted symbol
\\='nicknames, which matches the nickname of any user on the
current server.
BUTTON is the number of the regexp grouping actually matching the
button. This is ignored if REGEXP is \\='nicknames.
FORM is a Lisp expression which must eval to true for the button to
be added.
CALLBACK is the function to call when the user push this button.
CALLBACK can also be a symbol. Its variable value will be used
as the callback function.
PAR is a number of a regexp grouping whose text will be passed to
CALLBACK. There can be several PAR arguments. If REGEXP is
\\='nicknames, these are ignored, and CALLBACK will be called with
the nickname matched as the argument."
:version "24.1" ; remove finger (bug#4443)
:type '(repeat
(list :tag "Button"
(choice :tag "Matches"
regexp
(variable :tag "Variable containing regexp")
;; FIXME It really does mean 'nicknames
;; rather than just nicknames.
(const :tag "Nicknames" 'nicknames))
(integer :tag "Number of the regexp section that matches")
(choice :tag "When to buttonize"
(const :tag "Always" t)
(sexp :tag "Only when this evaluates to non-nil"))
(function :tag "Function to call when button is pressed")
(repeat :tag "Sections of regexp to send to the function"
:inline t
(integer :tag "Regexp section number")))))