Function: ibut:label-set

ibut:label-set is a byte-compiled function defined in hbut.el.

Signature

(ibut:label-set LABEL &optional START END)

Documentation

Set current implicit button label attributes.

Provide arguments LABEL and optional START, END positions. Return label. When START and END are given, they specify the region in the buffer to flash when this implicit button is activated or queried for its attributes; this typically should be the text of the button without any delimiters.

If LABEL is a list, it is assumed to contain all arguments.

For legacy reasons, the label here is actually the text of the implicit button matched contextually and never the optional <[name]> preceding the text.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hbut.el
(defun    ibut:label-set (label &optional start end)
  "Set current implicit button label attributes.
Provide arguments LABEL and optional START, END positions.
Return label.  When START and END are given, they specify the
region in the buffer to flash when this implicit button is
activated or queried for its attributes; this typically should
be the text of the button without any delimiters.

If LABEL is a list, it is assumed to contain all arguments.

For legacy reasons, the label here is actually the text of the
implicit button matched contextually and never the optional <[name]>
preceding the text."
  (save-match-data
    (cond ((stringp label)
	   (hattr:set 'hbut:current 'loc (save-excursion
					   (hbut:to-key-src 'full)))
	   (hattr:set 'hbut:current 'lbl-key (hbut:label-to-key label))
	   (when start (hattr:set    'hbut:current 'lbl-start start))
	   (when end   (hattr:set    'hbut:current 'lbl-end   end)))
	  ((and label (listp label))
	   (hattr:set 'hbut:current 'loc (save-excursion
					   (hbut:to-key-src 'full)))
	   (hattr:set 'hbut:current 'lbl-key (hbut:label-to-key (car label)))
	   (hattr:set 'hbut:current 'lbl-start (nth 1 label))
	   (hattr:set 'hbut:current 'lbl-end (nth 2 label)))
	  (t (error "(ibut:label-set): Invalid label arg: `%s'" label)))
    label))