Function: cape--dabbrev-bounds

cape--dabbrev-bounds is a byte-compiled function defined in cape.el.

Signature

(cape--dabbrev-bounds)

Documentation

Return bounds of abbreviation.

Source Code

;; Defined in ~/.emacs.d/elpa/cape-20260804.2303/cape.el
(defun cape--dabbrev-bounds ()
  "Return bounds of abbreviation."
  (unless (boundp 'dabbrev-abbrev-char-regexp)
    (require 'dabbrev))
  (let ((re (or dabbrev-abbrev-char-regexp "\\sw\\|\\s_"))
        (limit (minibuffer-prompt-end)))
    (if (or (looking-at re)
            (and (> (point) limit)
                 (save-excursion (forward-char -1) (looking-at re))))
        (cons (save-excursion
                (while (and (> (point) limit)
                            (save-excursion (forward-char -1) (looking-at re)))
                  (forward-char -1))
                (when dabbrev-abbrev-skip-leading-regexp
                  (while (looking-at dabbrev-abbrev-skip-leading-regexp)
                    (forward-char 1)))
                (point))
              (save-excursion
                (while (looking-at re)
                  (forward-char 1))
                (point)))
      (cons (point) (point)))))