Function: hierarchy-labelfn-button

hierarchy-labelfn-button is a byte-compiled function defined in hierarchy.el.gz.

Signature

(hierarchy-labelfn-button LABELFN ACTIONFN)

Documentation

Return a function rendering LABELFN in a button.

Clicking the button triggers ACTIONFN. ACTIONFN is a function taking an item of HIERARCHY and an indentation value (a number) as input. This function is called when an item is clicked. The return value of ACTIONFN is ignored.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/hierarchy.el.gz
(defun hierarchy-labelfn-button (labelfn actionfn)
  "Return a function rendering LABELFN in a button.

Clicking the button triggers ACTIONFN.  ACTIONFN is a function
taking an item of HIERARCHY and an indentation value (a number)
as input.  This function is called when an item is clicked.  The
return value of ACTIONFN is ignored."
  (lambda (item indent)
    (let ((start (point)))
      (funcall labelfn item indent)
      (make-text-button start (point)
                        'action (lambda (_) (funcall actionfn item indent))))))