Function: gbut:act

gbut:act is an interactive and byte-compiled function defined in hbut.el.

Signature

(gbut:act LABEL)

Documentation

Activate Hyperbole global button with LABEL.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hbut.el
;;; ========================================================================
;;; gbut class - Global Hyperbole buttons - activated by typing label name
;;; ========================================================================

(defun    gbut:act (label)
  "Activate Hyperbole global button with LABEL."
  (interactive (list (hargs:read-match "Activate global button labeled: "
				       (mapcar #'list (gbut:label-list))
				       nil t nil 'gbut)))
  (cond ((null label)
	 (error "(gbut:act): You have not created any global buttons"))
	((equal label "")
	 (error "(gbut:act): Please try again and type ? for a list of existing global button names"))
	(t (let* ((lbl-key (hbut:label-to-key label))
		  (but (gbut:get lbl-key)))
	     (if but
		 (progn
		   ;; Ensure gbut is activated with current-buffer as
		   ;; the context, not the gbut's source buffer.
		   (hattr:set but 'loc (current-buffer))
		   (hbut:act but))
	       (error "(gbut:act): No global button found for label: %s" label))))))