unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Philipp Stephani <p.stephani2@gmail.com>
To: Keith David Bershatsky <esq@lawlist.com>,
	Emacs Devel <emacs-devel@gnu.org>
Subject: Re: C equivalent for: (face-attribute 'region :background (selected-frame) 'default)
Date: Tue, 26 Sep 2017 18:46:05 +0000	[thread overview]
Message-ID: <CAArVCkQpTXPP7Cw7DmZqpshRoOJRqM8AyMgp1fcSL_AiWaoQ7g@mail.gmail.com> (raw)
In-Reply-To: <m2bmly6pn4.wl%esq@lawlist.com>

[-- Attachment #1: Type: text/plain, Size: 972 bytes --]

Keith David Bershatsky <esq@lawlist.com> 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);

[-- Attachment #2: Type: text/html, Size: 1414 bytes --]

  reply	other threads:[~2017-09-26 18:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-26  4:38 C equivalent for: (face-attribute 'region :background (selected-frame) 'default) Keith David Bershatsky
2017-09-26 18:46 ` Philipp Stephani [this message]
2017-09-26 23:19 ` YAMAMOTO Mitsuharu
  -- strict thread matches above, loose matches on Subject: below --
2017-09-26 18:38 Keith David Bershatsky
2017-09-29 13:25 ` Eli Zaretskii
2017-09-26 22:06 Keith David Bershatsky
2017-09-26 22:11 Keith David Bershatsky
2017-09-29 20:33 ` Philipp Stephani
2017-09-27  0:24 Keith David Bershatsky
2017-09-27  5:58 ` YAMAMOTO Mitsuharu
2017-10-05  0:24 Keith David Bershatsky
2017-10-05  6:47 ` Eli Zaretskii
2017-10-05  7:11   ` YAMAMOTO Mitsuharu
2017-10-06  3:53 Keith David Bershatsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAArVCkQpTXPP7Cw7DmZqpshRoOJRqM8AyMgp1fcSL_AiWaoQ7g@mail.gmail.com \
    --to=p.stephani2@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=esq@lawlist.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).