Function: hui:hbut-label-default

hui:hbut-label-default is a byte-compiled function defined in hui.el.

Signature

(hui:hbut-label-default START END &optional SKIP-LEN-TEST)

Documentation

Return default label based on START and END region markers or positions.

Optional SKIP-LEN-TEST means don't limit label to (hbut:max-len) length. Return nil if START or END are invalid or if region fails length test.

Also has side effect of moving point to start of default label, if any.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hui.el
(defun hui:hbut-label-default (start end &optional skip-len-test)
  "Return default label based on START and END region markers or positions.
Optional SKIP-LEN-TEST means don't limit label to (hbut:max-len) length.
Return nil if START or END are invalid or if region fails length test.

Also has side effect of moving point to start of default label, if any."
  (when (markerp start) (setq start (marker-position start)))
  (when (markerp end) (setq end (marker-position end)))
  ;; Test whether to use region as default button label.
  (when (and (integerp start) (integerp end)
	     (or skip-len-test
		 (<= (max (- end start) (- start end)) (hbut:max-len))))
    (goto-char start)
    (buffer-substring-no-properties start end)))