emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C equivalent for: (face-attribute 'region :background (selected-fram


From: Philipp Stephani
Subject: Re: C equivalent for: (face-attribute 'region :background (selected-frame) 'default)
Date: Tue, 26 Sep 2017 18:46:05 +0000



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");

// Calling
Lisp_Object o = CALLN (Ffuncall, Qface_attribute, Qregion, QCbackground, Fselected_frame (), Qdefault); 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]