Function: hbut:report
hbut:report is a byte-compiled function defined in hbut.el.
Signature
(hbut:report &optional ARG)
Documentation
Pretty print the attributes of a button or buttons.
Takes an optional ARG interpreted as follows:
a button symbol - report on that button;
nil - report on button at point, if any;
integer > 0 - report on all explicit buttons in buffer,
in lexicographical order;
integer < 1 - report on all explicit buttons in buffer,
in occurrence order.
Return number of buttons reported on or nil if none.
Aliases
ibut:summarize
hbut:help
hbut:summarize
Source Code
;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hbut.el
(defun hbut:report (&optional arg)
"Pretty print the attributes of a button or buttons.
Takes an optional ARG interpreted as follows:
a button symbol - report on that button;
nil - report on button at point, if any;
integer > 0 - report on all explicit buttons in buffer,
in lexicographical order;
integer < 1 - report on all explicit buttons in buffer,
in occurrence order.
Return number of buttons reported on or nil if none."
(setq arg (cond ((or (integerp arg) (symbolp arg)) arg)
((listp arg)
(if (integerp (setq arg (car arg))) arg 1))
(t 1)))
(let* ((but (if (and arg (symbolp arg)) arg (hbut:at-p)))
(curr-key (and but (hattr:get but 'lbl-key)))
(key-src (or (and but (hattr:get but 'loc)) (hbut:to-key-src)))
(lbl-lst (cond ((not arg)
(if curr-key (list (ebut:key-to-label curr-key))))
((symbolp arg) (if curr-key
(list (hbut:key-to-label
(hattr:get arg 'lbl-key)))))
((< arg 1) (ebut:list))
(t (sort (ebut:list)
(lambda (s1 s2)
(string< (downcase s1) (downcase s2)))))))
(key-buf (current-buffer))
(buf-name (hypb:help-buf-name))
(attribs)
;; Ensure these do not invoke with-output-to-temp-buffer a second time.
(temp-buffer-show-hook)
(temp-buffer-show-function))
(when lbl-lst
(with-help-window buf-name
(princ hbut:source-prefix)
(prin1 key-src)
(terpri)
(terpri)
(mapcar
(lambda (lbl)
(when (setq but (cond ((or (null arg) (symbolp arg)) but)
(t (ebut:get (ebut:label-to-key lbl) key-buf)))
attribs (hattr:list but))
(princ (if (ibut:is-p but)
lbl
(concat ebut:label-start lbl ebut:label-end)))
(terpri)
(hattr:report attribs)
(terpri)
(let ((doc (actype:doc but (= 1 (length lbl-lst)))))
(when doc
(princ " ")
(princ doc)
(terpri)))))
lbl-lst))
(length lbl-lst))))