Keith David Bershatsky <address@hidden
> schrieb am Di., 26. Sep. 2017 um 06:38 Uhr:
I am working on implementing my own feature requests to draw crosshairs (#17684) using multiple fake cursors (#22873), and I am trying to quickly convert (in C) the :background of the region face into a string -- e.g., "blue" or "#0000FF". My goal is to do all of this in C, and I would like to avoid porting (rewriting) several Lisp functions to give me the result of:
(face-attribute 'region :background (selected-frame) 'default)
Is there anything built-in into the Emacs C code base that already does this, or *almost* does this ...?
You can easily call Lisp functions from C.
// In syms_of_...
DEFSYM (Qface_attribute, "face-attribyte");
DEFSYM (Qregion, "region");
DEFSYM (QCbackground, ":background");
DEFSYM (Qdefault, "default");
Lisp_Object o = CALLN (Ffuncall, Qface_attribute, Qregion, QCbackground, Fselected_frame (), Qdefault);