Variable: erc-button-alist
erc-button-alist is a customizable variable defined in
erc-button.el.gz.
Value
((erc-button-url-regexp 0 t browse-url-button-open-url 0)
("[`‘]\\([a-zA-Z][-a-zA-Z_0-9!*<=>+]+\\)['’]" 1 t
erc-button-describe-symbol 1)
("\\(?:\\bInfo: ?\\|(info \\)[\"]\\(([^\"]+\\)[\"])?" 0 t info 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. Also, use of the special symbol `nicknames'
for this slot was deprecated in ERC 5.6, but users can still
use `erc-button-buttonize-nicks' to control whether nicks get
buttonized. And because customizing a corresponding CALLBACK
is no longer possible, an escape hatch has been provided via
the variable `erc-button-nickname-callback-function'.
BUTTON is the number of the regexp grouping actually matching the
button.
FORM is either a boolean or a special variable whose value must
be non-nil for the button to be added. It can also be a
function to call in place of `erc-button-add-button' with the
exact same arguments. When FORM is also a special variable,
ERC disregards the variable and calls the function. Note that
arbitrary s-expressions were deprecated in ERC 5.6 and may not
be respected in the future. If necessary, users can instead
supply a function that calls `erc-button-add-button' when such
an expression is non-nil.
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.
This variable was added, or its default value changed, in ERC version
5.6.
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.
'((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: ?\\|(info \\)[\"]\\(([^\"]+\\)[\"])?" 0 t info 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. Also, use of the special symbol `nicknames'
for this slot was deprecated in ERC 5.6, but users can still
use `erc-button-buttonize-nicks' to control whether nicks get
buttonized. And because customizing a corresponding CALLBACK
is no longer possible, an escape hatch has been provided via
the variable `erc-button-nickname-callback-function'.
BUTTON is the number of the regexp grouping actually matching the
button.
FORM is either a boolean or a special variable whose value must
be non-nil for the button to be added. It can also be a
function to call in place of `erc-button-add-button' with the
exact same arguments. When FORM is also a special variable,
ERC disregards the variable and calls the function. Note that
arbitrary s-expressions were deprecated in ERC 5.6 and may not
be respected in the future. If necessary, users can instead
supply a function that calls `erc-button-add-button' when such
an expression is non-nil.
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."
:package-version '(ERC . "5.6")
:type '(repeat
(list :tag "Button"
(choice :tag "Matches"
regexp
(variable :tag "Variable containing regexp")
(repeat :tag "List of words" string)
(alist :key-type string :value-type sexp))
(integer :tag "Number of the regexp section that matches")
(choice :tag "When to buttonize"
(const :tag "Always" t)
(function :tag "Alternative buttonizing function")
(variable :tag "Var with value treated as boolean"))
(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")))))