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#46515: Repeat mode Date: Mon, 15 Feb 2021 19:04:12 +0200 Organization: LINKOV.NET Message-ID: <87czx1z2ib.fsf@mail.linkov.net> References: <87pn12o74z.fsf@mail.linkov.net> <87sg5xy85o.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12654"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: 46515@debbugs.gnu.org To: Matt Armstrong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 15 18:13:07 2021 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 1lBhQm-00039f-RA for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 15 Feb 2021 18:13:04 +0100 Original-Received: from localhost ([::1]:36848 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBhQl-0003lG-SN for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 15 Feb 2021 12:13:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59812) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBhLu-0006jJ-Cw for bug-gnu-emacs@gnu.org; Mon, 15 Feb 2021 12:08:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55314) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lBhLu-0006vn-61 for bug-gnu-emacs@gnu.org; Mon, 15 Feb 2021 12:08:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lBhLu-0005sc-0j for bug-gnu-emacs@gnu.org; Mon, 15 Feb 2021 12:08:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 15 Feb 2021 17:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46515 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 46515-submit@debbugs.gnu.org id=B46515.161340886422558 (code B ref 46515); Mon, 15 Feb 2021 17:08:01 +0000 Original-Received: (at 46515) by debbugs.gnu.org; 15 Feb 2021 17:07:44 +0000 Original-Received: from localhost ([127.0.0.1]:38623 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lBhLc-0005rm-KR for submit@debbugs.gnu.org; Mon, 15 Feb 2021 12:07:44 -0500 Original-Received: from relay2-d.mail.gandi.net ([217.70.183.194]:43681) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lBhLX-0005rJ-MA for 46515@debbugs.gnu.org; Mon, 15 Feb 2021 12:07:40 -0500 X-Originating-IP: 91.129.108.204 Original-Received: from mail.gandi.net (m91-129-108-204.cust.tele2.ee [91.129.108.204]) (Authenticated sender: juri@linkov.net) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 6CF014000D; Mon, 15 Feb 2021 17:07:31 +0000 (UTC) In-Reply-To: <87sg5xy85o.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 15 Feb 2021 11:17:31 +0200") 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" Xref: news.gmane.io gmane.emacs.bugs:200075 Archived-At: --=-=-= Content-Type: text/plain >> repeat.el doesn't describe the key binding, but it does say a repeat >> mode is active. Kmacro is so smart that it aranges for the repeat key to >> be based on whatever key the command was invoked with. > > Unlike `indent-rigidly', `kmacro' message > > (Type e to repeat macro) > > is displayed on every keypress, so it's a good example. > Now added in the following patch applied over the previous patch. Here is another incremental patch that adds more messaging: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=repeat-message-2.patch diff --git a/lisp/repeat.el b/lisp/repeat.el index 3c8be63c84..a322afed1d 100644 --- a/lisp/repeat.el +++ b/lisp/repeat.el @@ -349,7 +349,16 @@ repeat-mode :global t :group 'convenience (if (not repeat-mode) (remove-hook 'post-command-hook 'repeat-post-hook) - (add-hook 'post-command-hook 'repeat-post-hook))) + (add-hook 'post-command-hook 'repeat-post-hook) + (let* ((keymaps nil) + (commands (all-completions + "" obarray (lambda (s) + (and (commandp s) + (get s 'repeat-map) + (push (get s 'repeat-map) keymaps)))))) + (message "Repeat mode is enabled for %d commands and %d keymaps" + (length commands) + (length (delete-dups keymaps)))))) (defun repeat-post-hook () "Function run after commands to set transient keymap." @@ -362,7 +371,10 @@ repeat-post-hook (let ((map (copy-keymap repeat-map))) (let (keys) (map-keymap (lambda (key _) (push (key-description (vector key)) keys)) map) - (message "To repeat type %s" (mapconcat #'identity keys ", "))) + (message "To repeat type %s%s" + (mapconcat #'identity keys ", ") + (when repeat-exit-key + (format ", or %s to exit" (key-description repeat-exit-key))))) (when repeat-exit-key (define-key map repeat-exit-key 'ignore)) (set-transient-map map)))))) --=-=-=--