From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.devel Subject: Re: Consistent face for keys in *Help* and `substitute-command-keys' Date: Wed, 24 Feb 2021 14:00:25 +0000 Message-ID: <87r1l5efba.fsf@tcd.ie> References: <87h7m5iagw.fsf@gnus.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="8230"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Lars Ingebrigtsen , 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 15:07:07 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 1lEuol-0001zA-7r for ged-emacs-devel@m.gmane-mx.org; Wed, 24 Feb 2021 15:07:07 +0100 Original-Received: from localhost ([::1]:48004 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lEuok-00025x-9R for ged-emacs-devel@m.gmane-mx.org; Wed, 24 Feb 2021 09:07:06 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59976) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lEuiO-0005Z6-Rk for emacs-devel@gnu.org; Wed, 24 Feb 2021 09:00:34 -0500 Original-Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:39371) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lEuiM-00080B-0a for emacs-devel@gnu.org; Wed, 24 Feb 2021 09:00:32 -0500 Original-Received: by mail-wr1-x434.google.com with SMTP id v1so1985155wrd.6 for ; Wed, 24 Feb 2021 06:00:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd.ie; s=google21; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=fg3B/AqwkbzSb4H878M6vLU1Keenj8nXhnT1JtEWA/w=; b=HuRnwNmh4zr3QjsMT6rHHAuXCFYBUV6Q6X+WzvrnOff3wDPLGsq43N5C/rpvtKQs5L Uj8/gm5Aouc1G5+7JDf12gjfjEYlnBXOh7nUgTnuLmJKKeZl6nP4S2fNf0hp6z0p0JYE 9qIuVSmZPgkjQMIdTo6216RemAUrqVJWWRdB5coHgBwNfsSWSe5vBJwFdCRN2AxYC5jJ qQT64QrX+iVxYwpsaOGwXTI88Avk5hYKRIP9giRVvZoykEF1yWDaWSOM9lkWERKBhNNt c7eo4BN2dFr1msVZWbebj6lrhBU5CSt338DGFtR2DfNsAjbd2TrZQl5WY1aRQErE0reA S8FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=fg3B/AqwkbzSb4H878M6vLU1Keenj8nXhnT1JtEWA/w=; b=jYK/EFdxUZ0Qvc03eFrTPaDvscXAPqCfNBfp4JfIRz5YX1q1S/GTCnomgKQpQRgUIU JIUN25F+dqTvyuZbTKdknrhDKdBPqw1KYZ7kQAVZH7n0yYIrS+ISE9UIs2+FS2oObAox T16sNWrlr4DV3Fv939h/GYRbT7ZtJNgfDtzqbD2oIJeKQ2W6On/3napy7ToFWn3mxfB1 Rj51UY+Ng5BEC6CGWrJa4ca6kiYcPnBKKb0Ln0NMzRNnGgGeTJ2jwk6AYop0S3o8wMRg iypuboxDN8J6EzmRToLo+XSIclMWXIUk5K/eCjHQURuG0LOaPDM886fN8Lj8ShKhlneS uUXg== X-Gm-Message-State: AOAM533P0djl39X9rNXz0QTI9VihDmIR1JHlXwGLfTbV+trB/q1WwkRL bUsaytN7rBEjiXt1d1MI20JW+g== X-Google-Smtp-Source: ABdhPJx0qtKgPn/SU2PG2QBQmSG2PFt4KR80viynqKAzLjxl2q30Bq1NZNW5DeV7Cyd6bM9DWyXjuQ== X-Received: by 2002:a5d:420d:: with SMTP id n13mr18792586wrq.312.1614175227422; Wed, 24 Feb 2021 06:00:27 -0800 (PST) Original-Received: from localhost ([2a02:8084:20e2:c380:d15:339e:aa10:60f1]) by smtp.gmail.com with ESMTPSA id l4sm3683865wrt.42.2021.02.24.06.00.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Feb 2021 06:00:26 -0800 (PST) In-Reply-To: (Stefan Kangas's message of "Tue, 23 Feb 2021 19:40:07 -0600") Received-SPF: none client-ip=2a00:1450:4864:20::434; envelope-from=contovob@tcd.ie; helo=mail-wr1-x434.google.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham 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:265573 Archived-At: Stefan Kangas writes: > Thoughts welcome. Thanks, just some questions from me. [...] > +(defface help-key-binding '((t :weight semi-bold :foreground "ForestGreen")) > + "Face for keybindings in *Help* buffers." > + :group 'help) Missing :version? > diff --git a/lisp/help-fns.el b/lisp/help-fns.el > index 7244695094..8277bbdad1 100644 > --- a/lisp/help-fns.el > +++ b/lisp/help-fns.el > @@ -466,12 +466,15 @@ help-fns--key-bindings > ;; If lots of ordinary text characters run this command, > ;; don't mention them one by one. > (if (< (length non-modified-keys) 10) > - (princ (mapconcat #'key-description keys ", ")) > + (with-current-buffer standard-output > + (insert (mapconcat #'help--key-description-fontified > + keys ", "))) Why is insert needed in place of princ here, but not below? > (dolist (key non-modified-keys) > (setq keys (delq key keys))) > (if keys > (progn > - (princ (mapconcat #'key-description keys ", ")) > + (princ (mapconcat #'help--key-description-fontified > + keys ", ")) [...] > + (replace-match (propertize > + (key-description > + (substring (this-command-keys) 0 -1)) > + 'font-lock-face 'help-key-binding > + 'face 'help-key-binding) Why not use help--key-description-fontified here? -- Basil