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: Sun, 07 Mar 2021 08:45:39 +0200 Message-ID: <83mtvftqb0.fsf@gnu.org> 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> <83mtvguog6.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21093"; 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 Sun Mar 07 07:47:32 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 1lInCO-0005Ne-Dt for ged-emacs-devel@m.gmane-mx.org; Sun, 07 Mar 2021 07:47:32 +0100 Original-Received: from localhost ([::1]:60802 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lInCN-0000QR-G8 for ged-emacs-devel@m.gmane-mx.org; Sun, 07 Mar 2021 01:47:31 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58836) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lInAm-0008I4-V3 for emacs-devel@gnu.org; Sun, 07 Mar 2021 01:45:55 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:53882) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lInAm-0005zW-80; Sun, 07 Mar 2021 01:45:52 -0500 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1167 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lInAk-0006k7-Ar; Sun, 07 Mar 2021 01:45:52 -0500 In-Reply-To: (message from Stefan Kangas on Sat, 6 Mar 2021 22:03:05 -0500) 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:266111 Archived-At: > From: Stefan Kangas > Date: Sat, 6 Mar 2021 22:03:05 -0500 > Cc: larsi@gnus.org, emacs-devel@gnu.org > > >> +*** Keybindings in 'help-mode' use the new `help-key-binding' face. > > > > I think this should mention substitute-command-keys, and say that any > > text that is run through that function will be propertized. I'd also > > mention the effect on tooltips there. > > How about this: > > *** Keybindings in 'help-mode' use the new 'help-key-binding' face. > This face is added by 'substitute-command-keys' to any "\[command]" > substitution. The return value of that function should consequently > be assumed to be a propertized string. > > Note that the new face will also be used in tooltips. When using the > GTK toolkit, this is only true if 'x-gtk-use-system-tooltips' is t. SGTM, thanks. > >> --- a/lisp/help.el > >> +++ b/lisp/help.el > >> @@ -104,8 +104,8 @@ help-map > >> (define-key map "R" 'info-display-manual) > >> (define-key map "s" 'describe-syntax) > >> (define-key map "t" 'help-with-tutorial) > >> - (define-key map "w" 'where-is) > >> (define-key map "v" 'describe-variable) > >> + (define-key map "w" 'where-is) > >> (define-key map "q" 'help-quit) > > > > Why the change in the order? > > It's just to make them alphabetical. That's what I thought, but then "q" is out of order, isn't it? > >> + (insert (propertize "M-x " > >> + 'face 'help-key-binding > >> + 'font-lock-face 'help-key-binding)) > > > > Why are we fontifying "M-x" here? > > I understand "M-x" to be part of the keybinding for that command, so I > think it makes sense to use the same face for that part too. IOW, > rather than fontifying only "apropos" in "M-x apropos" we fontify the > whole string. I'm not sure it's a good idea. "M-x foobar" is not a key sequence in the sense we use it for this feature, I think. This feature is not about displaying any key sequence in any context, it's about displaying them in the context of help-related text. But I have no strong opinions here.