Function: hui:ebut-edit-region

hui:ebut-edit-region is an interactive and byte-compiled function defined in hui.el.

Signature

(hui:ebut-edit-region)

Documentation

Create or edit an explicit Hyperbole button when conditions are met.

A region must have been delimited with the action-key and point must now be within it before this function is called or it will do nothing. The region must be no larger than the size given by a call to (hbut:max-len). It must be entirely within or entirely outside of an existing explicit button. When region is within the button, the button is interactively edited. Otherwise, a new button is created interactively with the region as the default label.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hui.el
(defun hui:ebut-edit-region ()
  "Create or edit an explicit Hyperbole button when conditions are met.
A region must have been delimited with the action-key and point must now be
within it before this function is called or it will do nothing.  The region
must be no larger than the size given by a call to (hbut:max-len).  It must
be entirely within or entirely outside of an existing explicit button.  When
region is within the button, the button is interactively edited.  Otherwise,
a new button is created interactively with the region as the default label."
  (interactive)
  (let ((m (mark))
	(op action-key-depress-prev-point) (p (point)) (lbl-key))
    (if (and m (eq (marker-buffer m) (marker-buffer op))
	     (< op m) (<= (- m op) (hbut:max-len))
	     (<= p m) (<= op p))
	(progn
	  (if (setq lbl-key (ebut:label-p))
	      (hui:ebut-edit lbl-key)
	    (hui:ebut-create op m))
	  t))))