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: Sun, 7 Mar 2021 02:26:27 -0500 Message-ID: References: <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> <83mtvftqb0.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="28078"; 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 Sun Mar 07 08:27:15 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 1lInoo-0007Cx-RC for ged-emacs-devel@m.gmane-mx.org; Sun, 07 Mar 2021 08:27:14 +0100 Original-Received: from localhost ([::1]:49612 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lInom-0001jg-Cq for ged-emacs-devel@m.gmane-mx.org; Sun, 07 Mar 2021 02:27:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35584) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lIno8-0001JS-5t for emacs-devel@gnu.org; Sun, 07 Mar 2021 02:26:32 -0500 Original-Received: from mail-pg1-f170.google.com ([209.85.215.170]:36102) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lIno6-0000pB-BW; Sun, 07 Mar 2021 02:26:31 -0500 Original-Received: by mail-pg1-f170.google.com with SMTP id t26so4332806pgv.3; Sat, 06 Mar 2021 23:26:29 -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=ju0+NeH/vQ4uUWrOJ/X69EIRgHmfWIGkQOnSavAxp+c=; b=UId+XfYnwp7jdMBXsjHWv5BXTlLMIVo+kjSgCjXFYQsjeuXiiLYnVQBSPbykZ9FjCH EdEscHTNI192mF1UEYqat6l+ViaBQUN9mbQP5zNcXlUFDCvDBG3oVwEk+nnzSiY5UwKu k1bxK/tlY3+sxwO5uaYDKyBuN3M71Wa4mx5UhM1ZyMNCZpjXDqagie8ARsHbJIO6zQDP 6fytJPBX7BnClox26s1NcwE3qc3cqh1aBhMDxIwL++rlbSHI3dcmmzokZ4zcyqWPA7Ya jHZofCbEqYtLlMKJgsUSXcoqOO84rhZIItJR2bEUAWDLIA1MUrvVYvTBpzPNUIVNHB+F 5PMA== X-Gm-Message-State: AOAM530Jd/sUh9ULpBO7YVtVUUnxKDcZZV2xxPPLxnpU9EneHh5YiWib oPQxlEGBTdcJd9yED2Z4jPNmil2dFsGYzBaEoWQiMP14XS4= X-Google-Smtp-Source: ABdhPJzHOlkgUAiQt3utfycAmf+NDR9Q9Si5/zNFWTRLav4OOrQaNJxp8CeHJA+C66Egb6BuavDNxJbeLmVGpNebX54= X-Received: by 2002:a63:6206:: with SMTP id w6mr13600808pgb.363.1615101988577; Sat, 06 Mar 2021 23:26:28 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 7 Mar 2021 02:26:27 -0500 In-Reply-To: <83mtvftqb0.fsf@gnu.org> Received-SPF: pass client-ip=209.85.215.170; envelope-from=stefankangas@gmail.com; helo=mail-pg1-f170.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:266117 Archived-At: Eli Zaretskii writes: >> It's just to make them alphabetical. > > That's what I thought, but then "q" is out of order, isn't it? Sure. I left it as it seemed to have been intentionally placed at the end -- the quit command is "special". But I don't have any strong preferences here, so please let me know if you want something changed. > 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. My thinking here is that the face should separate "anything that the user could type to run a command" from the surrounding body text. In this sense, there is no strong difference between an unbound command and an actual keybinding. It just seems more helpful. I don't see any obvious problems with this approach, but perhaps there is something that I'm overlooking. BTW, there was a bug in the above code where only the "M-x" part was fontified, now fixed: modified lisp/help.el @@ -1056,11 +1056,12 @@ substitute-command-keys (where-is-internal fun keymap t)))) (if (not key) ;; Function is not on any key. - (progn - (insert (propertize "M-x " - 'face 'help-key-binding - 'font-lock-face 'help-key-binding)) + (let ((op (point))) + (insert "M-x ") (goto-char (+ end-point 3)) + (add-text-properties op (point) + '( face help-key-binding + font-lock-face help-key-binding)) (delete-char 1))