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: Wed, 24 Feb 2021 10:35:47 -0600 Message-ID: References: <87h7m5iagw.fsf@gnus.org> <87r1l5efba.fsf@tcd.ie> 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="22524"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen , emacs-devel@gnu.org To: "Basil L. Contovounesios" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Feb 24 17:36:45 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 1lEx9Z-0005j7-0n for ged-emacs-devel@m.gmane-mx.org; Wed, 24 Feb 2021 17:36:45 +0100 Original-Received: from localhost ([::1]:32808 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lEx9Y-00087z-2L for ged-emacs-devel@m.gmane-mx.org; Wed, 24 Feb 2021 11:36:44 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38268) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lEx8i-0007DU-KX for emacs-devel@gnu.org; Wed, 24 Feb 2021 11:35:52 -0500 Original-Received: from mail-pg1-f169.google.com ([209.85.215.169]:44255) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lEx8g-0008Sb-Rn for emacs-devel@gnu.org; Wed, 24 Feb 2021 11:35:52 -0500 Original-Received: by mail-pg1-f169.google.com with SMTP id a4so1772253pgc.11 for ; Wed, 24 Feb 2021 08:35:49 -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=WHOnQdmBpfh8aufyc8LrqD25qITofkeONxhdBK6ZLrM=; b=QbcAWtVf++DeWksTAP5ff11aSkFiyVBKn705ZRFeusgJlAe1Pfy6ZStYmij8aBbkxt WnE0fZX3yRAj/bYXb8xV8EUKFjGQDyOtSAqK9XxWu6KYllaVvlPhJnaEIXJnrifIlah0 3EAvorb7475aXXU9Z2r5rsKLt6DdGW34L9DSzYdkzrCZjr1LI8d5HrcQnReqafXL92q8 1Iwt3EzoOGVJ5EFoNWyd9btkwL1Hb0BnokRRBv0Rfn0JNg3WyiCUaDF9lTOpxAdDEfM2 2KCA29Ur6w2KZzoKanUZocFIn2ke7zzkAhfjbEeEG8jgxluODIfapD8tqW95nSeAaAHQ XnNw== X-Gm-Message-State: AOAM531wjPbWBekcoUJnG5oXNQatimau0uZtVviJsD7vaSdhs/tST1AJ E79CuObJaEM9/zRTSPhfuTttt/j5psg83zS3lJA= X-Google-Smtp-Source: ABdhPJxNrA6k73yUrlEcJQwGPpqVGNfUmNMA1nEGgGBt+5K55Ww2cG/CWnSqbkD+oiQ7OLamwUmiUsnHWv99L+LI8Wg= X-Received: by 2002:aa7:8384:0:b029:1ed:1317:fbe4 with SMTP id u4-20020aa783840000b02901ed1317fbe4mr30042504pfm.57.1614184548491; Wed, 24 Feb 2021 08:35:48 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 24 Feb 2021 10:35:47 -0600 In-Reply-To: <87r1l5efba.fsf@tcd.ie> 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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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:265579 Archived-At: "Basil L. Contovounesios" writes: >> +(defface help-key-binding '((t :weight semi-bold :foreground "ForestGreen")) >> + "Face for keybindings in *Help* buffers." >> + :group 'help) > > Missing :version? Fixed. >> 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? We do need `insert' here. Fixed. >> (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? Using it would introduce a circular dependency between help-macro.el and help.el. Thanks for your comments.