Function: ibtype:create-regexp-link-type
ibtype:create-regexp-link-type is a function alias for defil, defined
in hbut.el.
Signature
(ibtype:create-regexp-link-type TYPE START-DELIM END-DELIM TEXT-REGEXP LINK-EXPR &optional START-REGEXP-FLAG END-REGEXP-FLAG DOC)
Documentation
Create Hyperbole implicit button link TYPE.
Use: TYPE (an unquoted symbol), START-DELIM and END-DELIM (strings), TEXT-REGEXP and LINK-EXPR.
With optional START-REGEXP-FLAG non-nil, START-DELIM is treated as a regular expression. END-REGEXP-FLAG treats END-DELIM as a regular expression. Hyperbole automatically creates a doc string for the type but you can override this by providing an optional DOC string.
TEXT-REGEXP must match to the text found between a button's delimiters in order for this type to activate. The matched text is applied to LINK-EXPR to produce the link's referent, which is then displayed.
LINK-EXPR may be:
(1) a brace-delimited key series;
(2) a URL;
(3) a path (possibly with trailing colon-separated line and column numbers);
(4) or a function or action type of one argument, the button text (sans the
function name if an Action Button), to display it.
Prior to button activation, for the first three kinds of
LINK-EXPR, a replace-match is done on the expression to
generate the button-specific referent to display. Thus, either
the whole button text (\\&) or any numbered grouping from
TEXT-REGEXP, e.g. \\1, may be referenced in the LINK-EXPR to
form the link referent.
Here is a sample use case. Create a button type whose buttons perform a grep-like function over a current repository's git log entries. The buttons use this format: [<text to match>].
The following defines the button type called search-git-log which calls hypb:fgrep-git-log with the text of the button as an argument:
(defil search-git-log "[<" ">]" ".*" #'hypb:fgrep-git-log)
Place point after one of the above expressions and evaluate it with
C-x C-e (eval-last-sexp) to define the implicit button type. Then if you
have cloned the Hyperbole repo and are in a Hyperbole source buffer,
an Action Key press on a button of the form:
;; [<test release>]
will display one line per commit whose change set matches "test release". An Action Key press on any such line will then display the commit changes.