Function: ebut:create

ebut:create is a byte-compiled function defined in hbut.el.

Signature

(ebut:create &optional BUT-SYM)

Documentation

Create Hyperbole explicit button based on optional BUT-SYM.

Default is the symbol hbut:current. Button should hold the following attributes (see hattr:set):
   lbl-key (normalized button label string),
   loc (filename or buffer where button is located),
   dir (directory name where button is located),
   actype (action type that provides a default action for the button),
   action (optional action that overrides the default),
   args (list of arguments for action, if action takes a single
            argument of the button lbl-key, args may be nil).

If successful, return any instance number to append to button label except when instance number would be "1", then return t. On failure, return nil.

If successful, leave point in button data buffer, so caller should use save-excursion. Does not save button data buffer.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hbut.el
(defun    ebut:create (&optional but-sym)
  "Create Hyperbole explicit button based on optional BUT-SYM.
Default is the symbol hbut:current.
Button should hold the following attributes (see `hattr:set'):
   lbl-key (normalized button label string),
   loc     (filename or buffer where button is located),
   dir     (directory name where button is located),
   actype  (action type that provides a default action for the button),
   action  (optional action that overrides the default),
   args    (list of arguments for action, if action takes a single
            argument of the button lbl-key, args may be nil).

If successful, return any instance number to append to button label
except when instance number would be \"1\", then return t.  On failure,
return nil.

If successful, leave point in button data buffer, so caller should use
`save-excursion'.  Does not save button data buffer."
  (let ((lbl-instance (hbdata:write nil but-sym)))
    (run-hooks 'ebut-create-hook)
    lbl-instance))