From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.devel Subject: Re: Consistent face for keys in *Help* and `substitute-command-keys' Date: Thu, 4 Mar 2021 00:24:14 -0600 Message-ID: References: <87h7m5iagw.fsf@gnus.org> <83blc9tnvz.fsf@gnu.org> <83y2fcrzkt.fsf@gnu.org> <831rd4romg.fsf@gnu.org> <83zgzsq7xn.fsf@gnu.org> <83v9afriqp.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31586"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Mar 04 07:25:36 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 1lHhQW-00086r-E5 for ged-emacs-devel@m.gmane-mx.org; Thu, 04 Mar 2021 07:25:36 +0100 Original-Received: from localhost ([::1]:39504 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lHhQV-0002I7-FF for ged-emacs-devel@m.gmane-mx.org; Thu, 04 Mar 2021 01:25:35 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58732) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lHhPH-0001ei-9z for emacs-devel@gnu.org; Thu, 04 Mar 2021 01:24:22 -0500 Original-Received: from mail-pg1-f169.google.com ([209.85.215.169]:43258) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lHhPF-0005o3-P7; Thu, 04 Mar 2021 01:24:19 -0500 Original-Received: by mail-pg1-f169.google.com with SMTP id n10so18220380pgl.10; Wed, 03 Mar 2021 22:24:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:mime-version:date :message-id:subject:to:cc; bh=o5SFgpYNVY2EN0sF6sgsrhxGWq8FsCO2yOFyKbkVuAQ=; b=fHc/hqmYBfjKpzF/TDHsKPcbRrvl+x9+vFKV69Wg6rFhPGshiqVIiIAFyVa+sh/ocG fkrVui+XJOVJmBcYz8ofK21gDUOwnfXyOGWQumLytxQO2DV7zh9YyoIo20PaKZjj6TD1 S/SVWMarBd2xlgnS+HKKv3aTWIGoxCrggWJqcuggNQJdwYxEy8/0898M4v+IqPCI4eYW vtoTBofq5zjNuV3OIwowYuHl9z4XlntPF7Q4BMh8+4QienLag+Tvm6Mb50Griz74RmEO 4bF2XXcAGjHlH5nSUeB2qptWwlXLb3iKcedZrZI3Y/n7CU7tG+TCy23bJxdOWKP/qXNb uV0w== X-Gm-Message-State: AOAM530Y81YvtILjTE23kN01QSsfO/qbiOHqsNgykUdMfC94HsfeDve7 IQRTud9Gjlv0L9mtNbmb+sNAdnh4PJk8H1Dazasn5/Rr X-Google-Smtp-Source: ABdhPJzPzdIXz7UHE9k6p/TvFOCgGBrc9kBvcnSeEVNKaLQpvXBpGcfsF4fxiZQgp8ffmWVb3E681B2Tf0iL/SjPIpw= X-Received: by 2002:a63:fd0a:: with SMTP id d10mr2368449pgh.345.1614839054937; Wed, 03 Mar 2021 22:24:14 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Thu, 4 Mar 2021 00:24:14 -0600 In-Reply-To: <83v9afriqp.fsf@gnu.org> Received-SPF: pass client-ip=209.85.215.169; envelope-from=stefankangas@gmail.com; helo=mail-pg1-f169.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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:265932 Archived-At: Eli Zaretskii writes: >> I think it is okay that tooltips do not use the `help-key-binding' face. > > If you are willing to give up on key sequences in tooltips, then why > do it in substitute-command-keys? I have thought a bit more about this and I can see that supporting this in tooltips could be useful. So I'll look into it. > So I guess we will need to change the design of this to avoid overriding > the whole face of a tooltip, or maybe add some special code to > help_echo_substitute_command_keys. Could we just use `add-face-text-property' here, perhaps? It seems to do what we want: (let ((foo "x") bar) (add-face-text-property 0 (length foo) 'bold nil foo) (setq bar (concat "y" foo "y")) (add-face-text-property 0 (length bar) 'italic nil bar) bar) => #("yxy" 0 1 (face italic) 1 2 (face (italic bold)) 2 3 (face italic))