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: Mon, 8 Mar 2021 13:10:09 +0200 Message-ID: References: <83y2fcrzkt.fsf@gnu.org> <831rd4romg.fsf@gnu.org> <83zgzsq7xn.fsf@gnu.org> <83v9afriqp.fsf@gnu.org> <83zgzjhvdn.fsf@gnu.org> <83a6rhxwah.fsf@gnu.org> <837dmlxspt.fsf@gnu.org> <834khpxr0s.fsf@gnu.org> <8335x8ybw9.fsf@gnu.org> <87czwageno.fsf@mail.linkov.net> 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="19196"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , larsi@gnus.org, emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Mar 08 12:11:11 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 1lJDn4-0004tD-QX for ged-emacs-devel@m.gmane-mx.org; Mon, 08 Mar 2021 12:11:10 +0100 Original-Received: from localhost ([::1]:38280 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJDn3-0005Em-Q8 for ged-emacs-devel@m.gmane-mx.org; Mon, 08 Mar 2021 06:11:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48630) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJDmA-0004jU-PU for emacs-devel@gnu.org; Mon, 08 Mar 2021 06:10:14 -0500 Original-Received: from mail-pf1-f172.google.com ([209.85.210.172]:45639) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJDm8-0007Nk-0i; Mon, 08 Mar 2021 06:10:14 -0500 Original-Received: by mail-pf1-f172.google.com with SMTP id j12so6813064pfj.12; Mon, 08 Mar 2021 03:10:11 -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=dcdrRH+VyuDcODnjN6PTK+AvFuXpHTtv9X66TKiwREA=; b=DJwqBUVYBYm2L1OVvHc9yzyIMTYX3E8cayynhVQtzCwv5CJDo0A7oPPhSeV36k3Gwy yBLdkhvEfIc7Q/UANBf0Fxv9XBMVUTTYDqPWShsNu6vfpBwAuW3JXgA+0DnoY2o87esx 3EjyGCPqnTNj0o2/kfhYZIPc5b/uhysBQdvT737gbzSu3vqyNalGTeV4MCsfWOOoFucZ +IO1FXbvPq07OOcch+4PHojEh7deNWIi/Hsi2xSbwqyIVjDs+HwqBWtEWEQ0rzeLt/PN WObgfQuPOSrTK9UYmgHt8s2KtBbAGtnU3OXKdL6tabXbejku1GuFyVxlebjbuo6M1WB9 6PJA== X-Gm-Message-State: AOAM532fw6gIcdyCreQhBNiV0vGrQLqUMcKmXYlsMJV2XV3Rp2sAwPgB eDVfV/ytL+JFbObRA8H3jXzet2zSbdpMalc+gNo= X-Google-Smtp-Source: ABdhPJyD5uBF2ilV5LiuA1qdYh+MX9WgtNU+/nvfnxEcXjs9tmdQv1lrORLMgIT9LZt8LCInUwbuVrpvl0rIRoJxCdQ= X-Received: by 2002:aa7:8889:0:b029:1ed:f38:4438 with SMTP id z9-20020aa788890000b02901ed0f384438mr20835202pfe.44.1615201810163; Mon, 08 Mar 2021 03:10:10 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 8 Mar 2021 13:10:09 +0200 In-Reply-To: <87czwageno.fsf@mail.linkov.net> Received-SPF: pass client-ip=209.85.210.172; envelope-from=stefankangas@gmail.com; helo=mail-pf1-f172.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_H2=-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:266171 Archived-At: Juri Linkov writes: >> + "Face for keybindings in *Help* buffers. > > I wonder why green? It looks quite weird. > > All the most popular > markup renderers nowadays such as GitHub and GitLab display keybindings > using light grey background like this: Yes, I agree. Sorry about that... I was considering for a while to do mimic the color scheme of VSCode: https://code.visualstudio.com/docs/getstarted/userinterface But I was going back and forth on this and in the end decided on using green (for now, and look at this more properly later). You are correct that green is not an excellent choice. > diff --git a/lisp/faces.el b/lisp/faces.el > index b2d47edca0..0f956b0cde 100644 > --- a/lisp/faces.el > +++ b/lisp/faces.el > @@ -2816,11 +2816,11 @@ help-argument-name > :group 'help) > > (defface help-key-binding > - '((((class color) (min-colors 88) (background light)) :foreground "ForestGreen") > - (((class color) (min-colors 88) (background dark)) :foreground "#44bc44") > - (((class color grayscale) (background light)) :foreground "grey15") > - (((class color grayscale) (background dark)) :foreground "grey85") > - (t :foreground "ForestGreen")) > + '((((class color) (min-colors 88) (background light)) :background "grey85") > + (((class color) (min-colors 88) (background dark)) :background "grey25") > + (((class color grayscale) (background light)) :background "grey85") > + (((class color grayscale) (background dark)) :background "grey25") > + (t :background "grey85")) > "Face for keybindings in *Help* buffers. Excellent idea, let's do it. But grey85 is much too dark. Compare grey85 (using M-x list-colors-display) to the hexadecimal values used in the VSCode documentation or on GitHub, and see that they use very bright greys (#f9f2f4 and #f6f8fa) while grey85 is #d9d9d9. I was toying with the much brighter grey95 (or perhaps something even brighter -- again, compare the hexadecimal values). Did you test this on a terminal, BTW? What do you think? Another thing I see is that they use more padding (a bigger square) around the keybindings. We can muck around with the display properties to achieve something similar, but the lines won't be even height. It would automatically look slightly better here if our `line-spacing' variable was something like 1, 2 or even 3 by default in these buffers. (This would really be a better all-around choice in all buffers for legibility, and is what is done on all modern text editors AFAICT.) (I was also looking at possibly using some blue colour for the foreground like VSCode does. It really looks superb in their use, and makes it highly readable. But it was tricky to do something similar when we also want to avoid confusion with our links. They also consistently use a subtle red #c7254e to highlight their functions, which is interesting [the idea, not the colour].) > This face is added by `substitute-command-keys', which see. > > BTW, I noticed after typing 'C-u C-x =' that face information is > duplicated: > > There are text properties here: > face help-key-binding > font-lock-face help-key-binding Yes, this is because this was the only way to get this to work consistently: in some buffers only `face' works and in others only `font-lock-face' works. :-(