Function: hui-select-boundaries
hui-select-boundaries is an interactive and byte-compiled function
defined in hui-select.el.
Signature
(hui-select-boundaries POS)
Documentation
Return the (start . end) of a syntactically defined region.
This is based upon the last region selected or on position POS. The character at POS is selected if no other thing is matched.
Key Bindings
Source Code
;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hui-select.el
;;
;; Functions
;;
(defun hui-select-boundaries (pos)
"Return the (start . end) of a syntactically defined region.
This is based upon the last region selected or on position POS.
The character at POS is selected if no other thing is matched."
(interactive)
(setcar hui-select-old-region (car hui-select-region))
(setcdr hui-select-old-region (cdr hui-select-region))
(let ((prior-type hui-select-previous))
(cond
((eq hui-select-previous 'char)
(hui-select-syntactical-region pos))
((and (car hui-select-old-region)
(memq hui-select-previous
'(sexp sexp-start sexp-end sexp-up))
(hui-select-sexp-up pos)
(hui-select-region-bigger-p hui-select-old-region hui-select-region))
hui-select-region)
;;
;; In the general case, we can't know ahead of time what the next
;; biggest type of thing to select is, so we test them all and choose
;; the best fit. This means that dynamically, the order of type
;; selection will change based on the buffer context.
(t (let ((min-region (1+ (- (point-max) (point-min))))
(result)
region region-size)
(mapc
(lambda (sym-func)
(setq region
(when (cadr sym-func)
(funcall (cadr sym-func) pos)))
(when (and region (car region)
(hui-select-region-bigger-p
hui-select-old-region region)
(setq region-size
(- (cdr region) (car region)))
(< region-size min-region))
(setq min-region region-size
result (list
;; The actual selection type is
;; sometimes different than the one we
;; originally tried, so recompute it here.
(car (assq hui-select-previous
hui-select-bigger-alist))
(car region) (cdr region)))))
hui-select-bigger-alist)
(if result
;; Return `hui-select-region'
(progn (setq hui-select-previous (car result))
(hui-select-set-region (nth 1 result) (nth 2 result)))
;;
;; Restore prior selection type since we failed to find a
;; new one
(setq hui-select-previous prior-type)
(beep)
(message
"(hui-select-boundaries): `%s' is the largest selectable region"
hui-select-previous)
nil))))))