From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: How to walk a Lisp_String? Date: Fri, 02 Sep 2022 18:33:34 +0300 Message-ID: <835yi5pz8x.fsf@gnu.org> References: <87a67jw1kw.fsf@elite.giraud> <83o7vzqey8.fsf@gnu.org> <83mtbjqemd.fsf@gnu.org> <87ler2963r.fsf@elite.giraud> <838rn2qnsf.fsf@gnu.org> <87wnam6y70.fsf@elite.giraud> <831qsuqllo.fsf@gnu.org> <87bkry6tnr.fsf@elite.giraud> <83tu5qoxol.fsf@gnu.org> <87mtbi57i2.fsf@elite.giraud> <83edwtq5z7.fsf@gnu.org> <87fsh96cxd.fsf@elite.giraud> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37524"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Manuel Giraud Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Sep 02 17:36:01 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oU8i9-0009c5-BS for ged-emacs-devel@m.gmane-mx.org; Fri, 02 Sep 2022 17:36:01 +0200 Original-Received: from localhost ([::1]:60744 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oU8i6-0000N6-VQ for ged-emacs-devel@m.gmane-mx.org; Fri, 02 Sep 2022 11:35:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34502) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oU8ft-0006fp-CE for emacs-devel@gnu.org; Fri, 02 Sep 2022 11:33:42 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:52158) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oU8fs-0000zT-Rg; Fri, 02 Sep 2022 11:33:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=gjxksLA7p0JD61pkuNCnC9KTXobmA3C5uI/sx2rnNSs=; b=ltkhsOr6TI/8 7VgT+MeHCybG/ywGYefCO1PmzzDgMukEdvnUSF4q3zmVNy4fxzwKlRjaxf+sJD99WbfAyMe/v6/7w 1UWuD/MDITU0Rypf06Fji+t/QcaBg+3uwQZoDlbjPY4tqDHe+SffS1rf/lbJNovZ5stVLhuaNLzw9 Fmb8IJTY90sBlOdbsdSCrJ5rya0S2bvyj9+H9A8gRd107kFHBapHtLf+MA8GnUX8YgnAiiCSuPJua 3MN0O1fGojXEHV4yzK3hl6i3zVym4XkPFrBmUqibIv1uE2VcMLqsBEkEC4e8KU0H7mnAQV+uksC5J G+wLMqMGShE40kANz9+Vvw==; Original-Received: from [87.69.77.57] (port=3790 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oU8fr-0002vi-OW; Fri, 02 Sep 2022 11:33:40 -0400 In-Reply-To: <87fsh96cxd.fsf@elite.giraud> (message from Manuel Giraud on Fri, 02 Sep 2022 16:58:22 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:294563 Archived-At: > From: Manuel Giraud > Cc: emacs-devel@gnu.org > Date: Fri, 02 Sep 2022 16:58:22 +0200 > > Eli Zaretskii writes: > > [...] > > > However, you still didn't answer my original question: where does the > > face information (colors and fonts) come from? The APIs I mention > > above will allow you to put the information on a Lisp string, but > > where will you get the information you need to put on those strings? > > Hum, I don't know. So far, I've initialized like this: > --8<---------------cut here---------------start------------->8--- > struct frame *f = XFRAME (frame); > struct face *face = FACE_FROM_ID (f, MENU_FACE_ID); > --8<---------------cut here---------------end--------------->8--- > > And it seems to work as intended (at least for fonts). What am I > missing? MENU_FACE_ID is the _basic_ face for menus, but it isn't the only face. By itself, it's used only for the menu bar. See term.c:tty_menu_activate for how we set up faces for the menu items: you will see that we use special faces for that. You will need either to introduce new faces for your case, or perhaps construct it from relevant X resources.