Is there a way to get the current cursor color?

Is there a way to get the current cursor color in Emacs?

I could only find

(set-cursor-color "white") 

But there is no "get-cursor-color".

He also does not look face:

(face-attribute 'cursor :foreground)
; => undefined

I have an idea that this is a "higher" level of binding (since it is also possible to set it as an argument to run Emacs).

But I would still like to temporarily change the color of the cursor; only if I know how to change it.

Given that the user can change the subject in the meantime, this should be the real “current” cursor color.

+4
source share
2 answers

It really is a face. However, not foreground, but background, i.e.

(face-attribute 'cursor :background)
; => "black"
+3
source

. , cursor-color. :background cursor.

:

(frame-parameter nil 'cursor-color)

FRAME:

(frame-parameter FRAME 'cursor-color)

. Elisp, node .

+2

Source: https://habr.com/ru/post/1622136/


All Articles