Function: ibut:to-text
ibut:to-text is a byte-compiled function defined in hbut.el.
Signature
(ibut:to-text LBL-KEY)
Documentation
Move to the text of the nearest implicit button matching LBL-KEY.
Find the nearest implicit button with LBL-KEY (a name or name key) within the visible portion of the current buffer and move to within its button text. This will find an implicit button if point is within its name or text or if LBL-KEY is a name/name-key of an existing implicit button. It will not find other unnamed implicit buttons.
The caller must have populated the attributes of ='hbut:current.
Return the symbol for the button if found, else nil.
Source Code
;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hbut.el
(defun ibut:to-text (lbl-key)
"Move to the text of the nearest implicit button matching LBL-KEY.
Find the nearest implicit button with LBL-KEY (a name or name key)
within the visible portion of the current buffer and move to within
its button text. This will find an implicit button if point is
within its name or text or if LBL-KEY is a name/name-key of an
existing implicit button. It will not find other unnamed implicit
buttons.
The caller must have populated the attributes of \='hbut:current.
Return the symbol for the button if found, else nil."
(unless (stringp lbl-key)
(error "(ibut:to-text): %s 'lbl-key' arg must be a string, not: %S"
(hattr:get 'hbut:current 'categ)
lbl-key))
(hbut:funcall
(lambda (lbl-key _buffer _key-src)
(let* ((name-end (hattr:get 'hbut:current 'name-end))
(at-name (hattr:get 'hbut:current 'name))
(at-text-key (hattr:get 'hbut:current 'lbl-key))
(opoint (point))
move-flag
start
ibut)
;; Do not move point if it is already in the text of an
;; implicit button matching LBL-KEY. If on the name of
;; the same button, move into the text of the button.
(cond ((and lbl-key (equal at-text-key lbl-key))
(setq ibut 'hbut:current))
((and at-name (equal (ibut:label-to-key at-name) lbl-key))
(setq ibut 'hbut:current
move-flag t))
((and lbl-key (setq ibut (ibut:to lbl-key)))
(setq move-flag t)))
(when (and move-flag ibut)
;; Skip past any optional name and separators
(if (setq start (hattr:get ibut 'lbl-start))
(goto-char start)
(when name-end
(goto-char name-end)
(if (looking-at ibut:label-separator-regexp)
;; Move past up to 2 possible characters of ibut
;; delimiters to ensure are inside the ibut name; this
;; prevents recognizing labeled, delimited ibuts of a
;; single character since no one should need that.
(goto-char (min (+ 2 (match-end 0)) (point-max)))
(goto-char opoint)))))
ibut))
lbl-key
(current-buffer)))