Function: hui-select-mark-delimited-sexp

hui-select-mark-delimited-sexp is an interactive and byte-compiled function defined in hui-select.el.

Signature

(hui-select-mark-delimited-sexp)

Documentation

When point is before or after an sexp deactivate the mark and mark the sexp.

Not enabled when point is at an end of line. Return t if marked, nil otherwise. If any error occurs such as unbalanced start and end sexp delimiters, ignore it, and return nil.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hui-select.el
(defun hui-select-mark-delimited-sexp ()
  "When point is before or after an sexp deactivate the mark and mark the sexp.
Not enabled when point is at an end of line.  Return t if marked,
nil otherwise.  If any error occurs such as unbalanced start and
end sexp delimiters, ignore it, and return nil."
  (interactive)
  (let ((mark-sexp-func (lambda ()
			  (when (region-active-p) (deactivate-mark))
			  (mark-sexp) t)))
    (ignore-errors
      (let ((syn-after (if (char-after) (char-syntax (char-after)) 0))
	    syn-before)
	(cond ((eq syn-after ?\()
	       (funcall mark-sexp-func))
	      ((eq syn-after ?\))
	       (forward-char 1)
	       (backward-sexp)
	       (funcall mark-sexp-func))
	      ((and (not (eolp))
		    (setq syn-before (if (char-before) (char-syntax (char-before)) 0))
		    (eq syn-before ?\)))
	       (backward-sexp)
	       (funcall mark-sexp-func)))))))