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: Consistent face for keys in *Help* and `substitute-command-keys' Date: Wed, 24 Feb 2021 18:51:00 +0200 Message-ID: <83a6rttnnv.fsf@gnu.org> References: <87h7m5iagw.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19081"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, emacs-devel@gnu.org To: Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Feb 24 17:53:26 2021 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 1lExPh-0004sW-VC for ged-emacs-devel@m.gmane-mx.org; Wed, 24 Feb 2021 17:53:25 +0100 Original-Received: from localhost ([::1]:49756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lExPh-0008Eu-1E for ged-emacs-devel@m.gmane-mx.org; Wed, 24 Feb 2021 11:53:25 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42070) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lExNe-0007Hm-MD for emacs-devel@gnu.org; Wed, 24 Feb 2021 11:51:18 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:37366) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lExNe-0004iv-9x; Wed, 24 Feb 2021 11:51:18 -0500 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4433 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lExNd-0001S6-E1; Wed, 24 Feb 2021 11:51:18 -0500 In-Reply-To: (message from Stefan Kangas on Tue, 23 Feb 2021 19:40:07 -0600) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:265582 Archived-At: > From: Stefan Kangas > Date: Tue, 23 Feb 2021 19:40:07 -0600 > Cc: emacs-devel@gnu.org > > --- a/src/keymap.c > +++ b/src/keymap.c > @@ -3021,7 +3021,10 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args, > if (!NILP (elt_prefix)) > insert1 (elt_prefix); > > - insert1 (Fkey_description (kludge, prefix)); > + Lisp_Object desc = Fkey_description (kludge, prefix); > + if (keymap_p) > + desc = CALLN (Fpropertize, desc, Qfont_lock_face, Qhelp_key_binding); > + insert1 (desc); Using Fpropertize here is suboptimal: it does several thing you don't need when calling it from C, including consing a new string, which is just a waste of cycles. Please use Fadd_text_properties instead.