Function: hui-select-thing

hui-select-thing is an autoloaded, interactive and byte-compiled function defined in hui-select.el.

Signature

(hui-select-thing &optional INTERACTIVE-FLAG)

Documentation

Select a region based on the syntax of the thing at point.

If invoked repeatedly, this selects bigger and bigger things. If hui-select-display-type is non-nil and this is called interactively, the type of selection is displayed in the minibuffer. The region selected is returned in (start . end) form.

If the key that invokes this command in hyperbole-minor-mode is also bound in the current major mode map, then interactively invoke that command instead. Typically prevents clashes over
{\C-c RET}, {\`C-c´ \C-m}.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hui-select.el
;;;###autoload
(defun hui-select-thing (&optional interactive-flag)
  "Select a region based on the syntax of the thing at point.
If invoked repeatedly, this selects bigger and bigger things.
If `hui-select-display-type' is non-nil and this is called
interactively, the type of selection is displayed in the minibuffer.
The region selected is returned in (start . end) form.

If the key that invokes this command in `hyperbole-minor-mode' is
also bound in the current major mode map, then interactively
invoke that command instead.  Typically prevents clashes over
{\\`C-c' RET}, {\\`C-c´ \\`C-m'}."
  (interactive "p")
  (when interactive-flag
    (cond ((use-region-p)
	   nil)
	  ((and transient-mark-mode mark-active)
	   nil)
	  (t
	   ;; Reset selection based on the syntax of character at point.
	   (hui-select-reset)
	   nil)))
  (let* ((key (hypb:cmd-key-vector #'hui-select-thing hyperbole-mode-map))
	 (major-mode-binding (lookup-key (current-local-map) key))
	 (this-key-flag (and interactive-flag
			     (equal (this-single-command-keys) key))))
    (cond ((and major-mode-binding (not (integerp major-mode-binding))
		this-key-flag)
	   ;; If the key that invokes this command in `hyperbole-minor-mode'
	   ;; is also bound in the current major mode map, then
	   ;; interactively invoke that command instead.  Typically
	   ;; prevents clashes over {C-c RET}, {C-c C-m}.
	   (call-interactively major-mode-binding))
	  ;;
	  ;; No key conflicts, perform normal Hyperbole operation
	  (t (let ((region (hui-select-get-region-boundaries)))
	       (unless region
		 (when (eq hui-select-previous 'punctuation)
		   (setq region (hui-select-word (point)))))
	       (when region
		 (goto-char (car region))
		 (set-mark (cdr region))
		 (when transient-mark-mode
		   (activate-mark))
		 (and interactive-flag hui-select-display-type
		      (message "%s" hui-select-previous))
		 (run-hooks 'hui-select-thing-hook)
		 region))))))