Function: hui-select-string

hui-select-string is a byte-compiled function defined in hui-select.el.

Signature

(hui-select-string POS)

Documentation

Return (start . end) of string including delimiters at POS, or nil.

Delimiters may be single, double or open and close quotes.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hui-select.el
(defun hui-select-string (pos)
  "Return (start . end) of string including delimiters at POS, or nil.
Delimiters may be single, double or open and close quotes."
  (setq hui-select-previous 'string)
  (save-excursion
    (goto-char pos)
    (if (and (memq major-mode hui-select-markup-modes)
	     (/= (following-char) ?\")
	     (save-excursion
	       (and (re-search-backward "[<>]" nil t)
		    (= (following-char) ?>))))
	(progn (setq hui-select-previous 'text)
	       (search-backward ">" nil t)
	       (hui-select-set-region
		(1+ (point))
		(progn (if (search-forward "<" nil 'end)
			   (1- (point))
			 (point)))))
      (or
       ;; double quotes
       (hui-select-string-p)
       ;; triple quotes
       (hui-select-string-p "'''" "'''")
       (hui-select-string-p "\"\"\"" "\"\"\"")
       ;; single quotes
       (hui-select-string-p "'" "'")
       ;; single smart quotes
       (hui-select-string-p "`" "'")))))