Based on Stefan Kangas comments, this minor mode mode changes the cursor
appearance to indicate overwrite mode or read-only buffers.

This is extracted from `cua-enable-cursor-indications'.

---------------–— Start of forwarded message ---------------–—
From: Stefan Kangas <stefankangas@gmail.com>
Subject: Re: Should 'cua-overwrite-cursor-color' be standalone?
To: Elijah Gabe Pérez <eg642616@gmail.com>, emacs-devel@gnu.org
Date: Sat, 22 Mar 2025 02:01:11 -0500 (1 day, 15 hours, 49 minutes ago)

Elijah Gabe Pérez <eg642616@gmail.com> writes:

I've noticed about this variable today, but
Should not this option be part of overwrite instead cua?
Or be a standalone minor-mode?

IMO, I find this useful outside cua.

I think a standalone mode is probably best, because if you want the
cursor color changed for overwrite-mode, you might want it for
buffer-read-only too.

In other words, I'd do both of these:

cua-overwrite-cursor-color
cua-read-only-cursor-color

FWIW, I have this in my init file since forever:

(setq my/set-cursor-color-color "")
(setq my/set-cursor-color-buffer "")
(defun my/set-cursor-color-according-to-mode ()
"Change cursor color according to some minor modes."
;; set-cursor-color is somewhat costly, so we only call it when needed:
(let ((color
(if buffer-read-only "#8888FF"
(if overwrite-mode "#000000"
"#FF0000"))))
(unless (and
(string= color my/set-cursor-color-color)
(string= (buffer-name) my/set-cursor-color-buffer))
(set-cursor-color (setq my/set-cursor-color-color color))
(setq my/set-cursor-color-buffer (buffer-name)))))
(add-hook 'post-command-hook 'my/set-cursor-color-according-to-mode)

I picked it up on EmacsWiki years ago.

---------------–— End of forwarded message ---------------–—