From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#70576: [PATCH] `repeat-echo-message-string': support repeat keymap "hints" Date: Sun, 28 Apr 2024 09:58:10 +0300 Organization: LINKOV.NET Message-ID: <86cyqaezhc.fsf@mail.linkov.net> References: <45C35B69-6DA8-4212-BD87-50B2A3959A86@gmail.com> <86h6fo3e7e.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23154"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: 70576@debbugs.gnu.org To: JD Smith Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 28 09:18:08 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1s0ynY-0005sL-61 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 28 Apr 2024 09:18:08 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s0ynD-0008Vp-Do; Sun, 28 Apr 2024 03:17:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s0yn9-0008UU-T2 for bug-gnu-emacs@gnu.org; Sun, 28 Apr 2024 03:17:44 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s0yn9-0000Pb-Hu for bug-gnu-emacs@gnu.org; Sun, 28 Apr 2024 03:17:43 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s0ynS-0002JN-Cj for bug-gnu-emacs@gnu.org; Sun, 28 Apr 2024 03:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 Apr 2024 07:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70576 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 70576-submit@debbugs.gnu.org id=B70576.17142886588873 (code B ref 70576); Sun, 28 Apr 2024 07:18:02 +0000 Original-Received: (at 70576) by debbugs.gnu.org; 28 Apr 2024 07:17:38 +0000 Original-Received: from localhost ([127.0.0.1]:50018 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s0yn3-0002J3-KM for submit@debbugs.gnu.org; Sun, 28 Apr 2024 03:17:38 -0400 Original-Received: from relay9-d.mail.gandi.net ([2001:4b98:dc4:8::229]:35735) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s0ymy-0002Iv-B9 for 70576@debbugs.gnu.org; Sun, 28 Apr 2024 03:17:36 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 69B65FF802; Sun, 28 Apr 2024 07:17:03 +0000 (UTC) In-Reply-To: (JD Smith's message of "Fri, 26 Apr 2024 10:37:51 -0400") X-GND-Sasl: juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:284078 Archived-At: >> (defvar-keymap expreg-repeat-map >> :doc "Repeat map for `expreg' actions." >> :repeat t >> "\\" 'expreg-expand >> "|" 'expreg-contract) >> >> (put 'expreg-expand 'repeat-hint "expand") >> (put 'expreg-contract 'repeat-hint "contract") > > Thanks for taking a look. A property on the command could work (and then > you need no :name). It would be somewhat harder to maintain the structure > for long keymaps, e.g. if a command changes. I do note that menu-item with > :filter is commonly recommended for non-menu dynamic bindings, so there is > some precedent of reusing menu functionality in other contexts. As a more complicated feature, usually :filter is added by developers for specific functionality, it's not intended to be used by users in their normal customization of keymaps, like users will configure hints. > Of course a new wrapper macro could also be developed to ease this. > Do you anticipate any specific issues? Here is what I recommend to do to simplify the definition of hints for users. Like there can be a list of enter and exit commands in 'defvar-keymap': :repeat ‘(:enter (commands ...) :exit (commands ...))’ the same list could be used for hints: :repeat ‘(:enter (commands ...) :exit (commands ...) :hints ((command . hint) ...))’ This should be easier to document and to understand by users than a special syntax of cons for binding and the requirement to add :name.