From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.help Subject: Re: Lucid menu faces Date: Thu, 21 Jul 2022 09:21:26 +0800 Message-ID: <87bktj9s6h.fsf@yahoo.com> References: <874jzbhm0z.fsf@elite.giraud> <83mtd3lqgv.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25546"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 21 03:22:29 2022 Return-path: Envelope-to: geh-help-gnu-emacs@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 1oEKtZ-0006Xm-CT for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 21 Jul 2022 03:22:29 +0200 Original-Received: from localhost ([::1]:41686 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oEKtX-0003x5-Qy for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 20 Jul 2022 21:22:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41970) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEKsu-0003wr-QO for help-gnu-emacs@gnu.org; Wed, 20 Jul 2022 21:21:48 -0400 Original-Received: from sonic317-33.consmr.mail.ne1.yahoo.com ([66.163.184.44]:38312) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oEKsl-0002Sc-Eo for help-gnu-emacs@gnu.org; Wed, 20 Jul 2022 21:21:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1658366495; bh=agV7w/swpmI/jz8o05VYMWR2bT+voRnXyRe3FsX/FXw=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=JGvZZSQwJwTw152rkE915hozLr3W7c9opUniQNrPQqa6CorQ2HS+gwuhlR/M37a9cymH4v7zOaInYETKFl+nt6423YZyC+fIP8Z5duvcdpxPlWO81mBs7U+f3VusKxf0AJc/e/LVCRkpBA5yTuaeYGqY7QbWv9GLVBw1bYwjqfpKwebMY4MPB4EoHS/igHlWBAJzi9NVhYmmedrocsQKKk6nuyPy2UbburOo31PwsR/fjfyZqpIb992Rhr0fR4ifVt/euIpbB/BJA7J5jiroDQL1Tew9dl9/IvR8fR2Y+rgdqfxM5MBBY9CgzbFNmRhhYhuxXiFU1adYM0GAPLOkkw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1658366495; bh=2WHfWRSuCaugOC3+zT2T+OdcnDEJeRcjHyi17cb+eld=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=FxQ3j7kN2kzfOSCUy7ujVo+cGSJaXPPdrZ866fRprHIlUtOkK+iI1z1Nq0EHSftTo57sSXLR1w+MRHUoBR5ITSO7rWrpUlD5fuZ+b+Fng0L7d3b794iUVc3t+NDzheHKYFuWaglA/o6r73ZQW5Zj5yslQQSn7skOjvX3lIrC+XJq3sbg4lRu4zBHfSBwl8NZmMaJBlBj0CN9kOzDYzLYXnYhIVU2PHyPgzWbl4UsNZPEffKjwQ8+jfTTGQ4AWI6LvAAOMoaqvlslIa/L85Hos6nM+HTFXGvH1ol77qWGdrTrQP2A1vAZJhXppnLoThxv047u1XTAA77g6ygIhDocYA== X-YMail-OSG: hKaBHEkVM1mZK4BKj5i.adddiOTG0gW2kReNU4MrgLrcmU3NUh70VCNJ6rT9ZcE otWt9tz28FT6lLB3zG4bCLv4dANRkjZmCriXbQ3SW.KJQFte.4J12rmoxhO5a468e3BlDdwx5Gz1 juk7bdALhkM78FjHeYlt0C_Nj.ACnT6L7beEczc6uU4Pd9oiXcHi45LfA.3kI0IJS6IscHwWhHOh 50oqsvyqBmUoHivegMGbCquHBE0mznylninj7p3YrLyYi9_cZzwTBSYXpvEETOTw2OcVAnNCJLt5 d7TC39NIGEVDkWqRw9CshjALiJszB.43jNm2M7vk6pyV_nv2GVpgbMey_jlVbZufbZQSOYj9VTkg 3Fs7S135J2PRT9yeY7DKiCBWu_3pGPUEs0NMrvc9pkIHd578iVDWsXlsKDvDwBdsCsvac23YCn5Z Lx9su_z0P.fBF6tPUFwF5MMTurgKRh.P0uP9AQgUnVeM9UjnzkBN5RxO.ZZmhoYIFNryPbSwT0sK wTEqXekBtyd5fM3vpVhio_DmIn.hrtrcFXKw29fyReE7GLzm7_YpWNdQKSaq2Fl5NqI1uWgdbggy vsuUR9cjhYtu0hTLIgfNR7HdEhXHfZLFQO3X.FQNINaOGbanAoE0SFWw39HMWVkY6P7sdzAc0__V 8zV2OuhFAG_Tw8l2TzI_ponuXzEnhq_UY9TA2_uRxSoHmlHNsGJ19xqSzhj_xtv7IaKnWHvC5EFZ 0roEuIMlrxmwIiZNYdNSmoyxf4G.xeW2e_MZgcT9Y27uXTqwM_RBvTi2TwfX6bRBaVMnlXN6CKgv UxqJVA.uFP6bvgvjW5xaNUB2u2Y1MF8ngkOchZoiBx X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.ne1.yahoo.com with HTTP; Thu, 21 Jul 2022 01:21:35 +0000 Original-Received: by hermes--canary-production-sg3-67975bbd4b-v4p6m (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID c95242802127959981493c506cadf907; Thu, 21 Jul 2022 01:21:32 +0000 (UTC) In-Reply-To: <83mtd3lqgv.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 20 Jul 2022 19:05:20 +0300") X-Mailer: WebService/1.1.20447 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.184.44; envelope-from=luangruo@yahoo.com; helo=sonic317-33.consmr.mail.ne1.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:138543 Archived-At: Eli Zaretskii writes: > Isn't it true that the appearance of toolkit menus can be fully > controlled only through X resources? Toolkits are not part of Emacs, > so they don't abide by our Lisp trickery. We are all spoiled rotten > by Emacs letting us control everything via Lisp objects and > properties, but the truth is that it only works because Emacs has code > to make it work. Toolkits don't: they have no idea what is a 'face' > in its Emacs interpretation. Yes. There is a hack in xfaces.c wrt the `menu' face: static void x_update_menu_appearance (struct frame *f) { struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f); XrmDatabase rdb; if (dpyinfo && (rdb = XrmGetDatabase (FRAME_X_DISPLAY (f)), rdb != NULL)) { char line[512]; char *buf = line; ptrdiff_t bufsize = sizeof line; Lisp_Object lface = lface_from_face_name (f, Qmenu, true); struct face *face = FACE_FROM_ID (f, MENU_FACE_ID); const char *myname = SSDATA (Vx_resource_name); bool changed_p = false; #ifdef USE_MOTIF const char *popup_path = "popup_menu"; #else const char *popup_path = "menu.popup"; #endif if (STRINGP (LFACE_FOREGROUND (lface))) { exprintf (&buf, &bufsize, line, -1, "%s.%s*foreground: %s", myname, popup_path, SDATA (LFACE_FOREGROUND (lface))); XrmPutLineResource (&rdb, line); exprintf (&buf, &bufsize, line, -1, "%s.pane.menubar*foreground: %s", myname, SDATA (LFACE_FOREGROUND (lface))); XrmPutLineResource (&rdb, line); changed_p = true; } if (STRINGP (LFACE_BACKGROUND (lface))) { exprintf (&buf, &bufsize, line, -1, "%s.%s*background: %s", myname, popup_path, SDATA (LFACE_BACKGROUND (lface))); XrmPutLineResource (&rdb, line); exprintf (&buf, &bufsize, line, -1, "%s.pane.menubar*background: %s", myname, SDATA (LFACE_BACKGROUND (lface))); XrmPutLineResource (&rdb, line); changed_p = true; } if (face->font /* On Solaris 5.8, it's been reported that the `menu' face can be unspecified here, during startup. Why this happens remains unknown. -- cyd */ && FONTP (LFACE_FONT (lface)) && (!UNSPECIFIEDP (LFACE_FAMILY (lface)) || !UNSPECIFIEDP (LFACE_FOUNDRY (lface)) || !UNSPECIFIEDP (LFACE_SWIDTH (lface)) || !UNSPECIFIEDP (LFACE_WEIGHT (lface)) || !UNSPECIFIEDP (LFACE_SLANT (lface)) || !UNSPECIFIEDP (LFACE_HEIGHT (lface)))) { Lisp_Object xlfd = Ffont_xlfd_name (LFACE_FONT (lface), Qnil); #ifdef USE_MOTIF const char *suffix = "List"; bool motif = true; #else #if defined HAVE_X_I18N const char *suffix = "Set"; #else const char *suffix = ""; #endif bool motif = false; #endif if (! NILP (xlfd)) { #if defined HAVE_X_I18N char *fontsetname = xic_create_fontsetname (SSDATA (xlfd), motif); #else char *fontsetname = SSDATA (xlfd); #endif exprintf (&buf, &bufsize, line, -1, "%s.pane.menubar*font%s: %s", myname, suffix, fontsetname); XrmPutLineResource (&rdb, line); exprintf (&buf, &bufsize, line, -1, "%s.%s*font%s: %s", myname, popup_path, suffix, fontsetname); XrmPutLineResource (&rdb, line); changed_p = true; if (fontsetname != SSDATA (xlfd)) xfree (fontsetname); } } if (changed_p && f->output_data.x->menubar_widget) free_frame_menubar (f); if (buf != line) xfree (buf); } }