Function: ibut:label-p
ibut:label-p is a byte-compiled function defined in hbut.el.
Signature
(ibut:label-p &optional AS-LABEL START-DELIM END-DELIM POS-FLAG TWO-LINES-FLAG)
Documentation
Return key for the implicit button name that point is within, else nil.
Without the start and end delimiter arguments, this is the normalized key form of the optional name that may precede an implicit button. If the delimiter arguments are given, return the key form of the implicit button text at point between those delimiters. Point must be within the first line and after the opening delimiter of any button to get the key.
Alternatively, use ibut:at-p to test if point is on either the implicit button text itself or the name.
All following arguments are optional. If AS-LABEL is non-nil, label is returned rather than the key derived from the label. START-DELIM and END-DELIM are strings that override default button label delimiters. With POS-FLAG non-nil, return list of label-or-key, but-label-start-position, but-label-end-position. Positions include delimiters. With TWO-LINES-FLAG non-nil, constrain label search to two lines.
Source Code
;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hbut.el
(defun ibut:label-p (&optional as-label start-delim end-delim pos-flag two-lines-flag)
"Return key for the implicit button name that point is within, else nil.
Without the start and end delimiter arguments, this is the normalized
key form of the optional name that may precede an implicit button.
If the delimiter arguments are given, return the key form of the
implicit button text at point between those delimiters. Point must be
within the first line and after the opening delimiter of any button to
get the key.
Alternatively, use `ibut:at-p' to test if point is on either the
implicit button text itself or the name.
All following arguments are optional. If AS-LABEL is non-nil, label is
returned rather than the key derived from the label. START-DELIM and
END-DELIM are strings that override default button label delimiters.
With POS-FLAG non-nil, return list of label-or-key,
but-label-start-position, but-label-end-position. Positions include
delimiters. With TWO-LINES-FLAG non-nil, constrain label search to two
lines."
(unless start-delim
(setq start-delim ibut:label-start))
(unless end-delim
(setq end-delim ibut:label-end))
(let ((lbl)
(result (with-syntax-table hbut:syntax-table
(if (or (string-prefix-p "<" start-delim)
(string-suffix-p ">" end-delim))
(ebut:label-p as-label start-delim end-delim
pos-flag two-lines-flag)
;; When delims do not end with <>, then filter out matches
;; that are surrounded by angle brackets, e.g. [str] should
;; not match to occurrences of <[str]>.
(hargs:delimited (concat "<?" (regexp-quote start-delim))
(concat (regexp-quote end-delim) ">?")
t t pos-flag "\\`<.*>\\'" (not as-label))))))
(when result
(setq lbl (if (listp result) (car result) result))
;; Ensure match does not contain delimiters, as it may have run
;; past the beginning of another button.
(when lbl
(unless (string-match (concat (regexp-quote start-delim) "\\|"
(regexp-quote end-delim))
lbl)
result)))))