Function: hui:ebut-link-create

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

Signature

(hui:ebut-link-create EDIT-FLAG BUT-WINDOW LBL-KEY BUT-LOC BUT-DIR TYPE-AND-ARGS)

Documentation

Create or edit a new Hyperbole explicit link button.

If EDIT-FLAG is non-nil, edit button at point in BUT-WINDOW, otherwise, prompt for button label and create a button. LBL-KEY is internal form of button label. BUT-LOC is the file or buffer in which to create the button. BUT-DIR is the directory of BUT-LOC. TYPE-AND-ARGS is the action type for the button followed by any arguments it requires. Any text properties are removed from string arguments.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hui.el
(defun hui:ebut-link-create (edit-flag but-window lbl-key but-loc but-dir type-and-args)
  "Create or edit a new Hyperbole explicit link button.
If EDIT-FLAG is non-nil, edit button at point in BUT-WINDOW,
otherwise, prompt for button label and create a button.
LBL-KEY is internal form of button label.  BUT-LOC is the file or buffer
in which to create the button.  BUT-DIR is the directory of BUT-LOC.
TYPE-AND-ARGS is the action type for the button followed by any
arguments it requires.  Any text properties are removed from string
arguments."
  (hattr:set 'hbut:current 'categ 'explicit)
  (hattr:set 'hbut:current 'loc but-loc)
  (hattr:set 'hbut:current 'dir but-dir)
  (hattr:set 'hbut:current 'actype (actype:elisp-symbol (car type-and-args)))
  (hattr:set 'hbut:current 'args (cdr type-and-args))
  (select-window but-window)
  ;; It is rarely possible that a *Warnings* buffer popup might have
  ;; displaced `but-loc' in the window, so switch to it to be safe.
  (unless (and but-loc (or (equal (buffer-name) but-loc)
			   (eq (current-buffer) but-loc)))
    (hbut:key-src-set-buffer but-loc))
  (let ((label (hbut:key-to-label lbl-key)))
    (ebut:operate label (when edit-flag label))))