Function: eca-chat-inline--anchor-bounds
eca-chat-inline--anchor-bounds is a natively compiled function defined
in eca-chat-inline.el.
Signature
(eca-chat-inline--anchor-bounds)
Documentation
Return full-line (START . END) bounds for the overlay anchor.
Uses the active region when set, otherwise the current line. The trailing newline is covered so the anchor keymap stays active at end of line (keymaps follow the char after point) and a zero-width anchor (empty line) survives evaporation.
Source Code
;; Defined in /nix/store/jklqzw6pzz6j4jrbv8wy0iwgi7jlrbld-emacs-packages-deps/share/emacs/site-lisp/elpa/eca-20260928.1827/eca-chat-inline.el
(defun eca-chat-inline--anchor-bounds ()
"Return full-line (START . END) bounds for the overlay anchor.
Uses the active region when set, otherwise the current line. The
trailing newline is covered so the anchor keymap stays active at
end of line (keymaps follow the char after point) and a zero-width
anchor (empty line) survives evaporation."
(let ((bounds
(if (use-region-p)
(let* ((rb (region-beginning))
(re (region-end))
;; A region ending at bol (whole-lines selection)
;; should not drag the next line into the anchor.
(re (if (and (> re rb)
(save-excursion (goto-char re) (bolp)))
(1- re)
re)))
(cons (save-excursion (goto-char rb)
(line-beginning-position))
(save-excursion (goto-char re)
(line-end-position))))
(cons (line-beginning-position) (line-end-position)))))
(if (< (cdr bounds) (point-max))
(cons (car bounds) (1+ (cdr bounds)))
bounds)))