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#74140: [PATCH] Add :continue-only directive for repeat maps in bind-keys, use-package Date: Mon, 04 Nov 2024 21:22:29 +0200 Organization: LINKOV.NET Message-ID: <87ldxy953e.fsf@mail.linkov.net> References: <86plnf9xqm.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34790"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) Cc: 74140@debbugs.gnu.org To: Paul Nelson Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 04 20:25:32 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 1t82hg-0008sW-7b for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 04 Nov 2024 20:25:32 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t82hH-0001nt-8U; Mon, 04 Nov 2024 14:25:07 -0500 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 1t82hE-0001iW-4P for bug-gnu-emacs@gnu.org; Mon, 04 Nov 2024 14:25:04 -0500 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 1t82hD-0003gv-9L for bug-gnu-emacs@gnu.org; Mon, 04 Nov 2024 14:25:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=ANs48VHcPRQcMRQiIQZYecoWGViKjepGESpdGkp2vRc=; b=vZt/6+dwTqdZuWDLo3Qc8OOzMYw7fDV8vxXxzxkuLQomI1h1bgTdCW9ZenyCCmDFwkwMQN0KGWwHLor/I5uRIFEQSYtpgYNHMBxPQAaDBeok9tUA+jkelU6XljIuzBFmMzFKzme7ZVwgiEAXi1YAt+4zsBQ+TavVh3LXetRocqYJ8tEP6ODyYxnYqKTY5K+bKbGs6QpBWpTeDeINLABf2eUgU000413JQF8SNN/pJJsKU+gaFzEsZ8WHXn3VsPYOc3aYnApJT7DW5CE61jdkM5L1MFDJ29nzbuBYqhGki5v2lV/kpzkufFSCJ9rIxLvLRkI0DDvmEhv0VtDnJo3akg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t82hC-0006HD-4E for bug-gnu-emacs@gnu.org; Mon, 04 Nov 2024 14:25: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, 04 Nov 2024 19:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74140 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 74140-submit@debbugs.gnu.org id=B74140.173074829024110 (code B ref 74140); Mon, 04 Nov 2024 19:25:02 +0000 Original-Received: (at 74140) by debbugs.gnu.org; 4 Nov 2024 19:24:50 +0000 Original-Received: from localhost ([127.0.0.1]:41813 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t82gz-0006Gm-RB for submit@debbugs.gnu.org; Mon, 04 Nov 2024 14:24:50 -0500 Original-Received: from relay9-d.mail.gandi.net ([217.70.183.199]:39657) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t82gx-0006Ge-MT for 74140@debbugs.gnu.org; Mon, 04 Nov 2024 14:24:48 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 8FFFFFF804; Mon, 4 Nov 2024 19:24:38 +0000 (UTC) In-Reply-To: (Paul Nelson's message of "Fri, 1 Nov 2024 09:58:07 +0100") 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:294875 Archived-At: >> > > With this patch, the available directives are: >> > > :continue (default) - activates and continues >> > > :exit - neither activates nor continues >> > > :continue-only (new) - continues, but does not activate >> > >> > How does this map to the properties ':enter' and ':exit' of 'defvar-keymap'? >> >> :exit has the same meaning in both. >> >> In defvar-keymap, :enter means "activate, but do not continue". > > Another difference is that :enter from defvar-keymap does not actually > bind a key in the keymap, thus: > > activate continue bind > :continue yes yes yes > :continue-only no yes yes > :exit no no yes > :enter yes no no Thanks, this table provides a clear overview. So bind-keys doesn't need :enter? Ok. Since defvar-keymap uses :continue by default, what is missing in defvar-keymap is :continue-only. For adding :continue-only to defvar-keymap I looked how you implemented it for bind-keys, and it seems making an alias doesn't look like a clean solution. I know that 'define-repeat-map' makes an alias as well. So some time ago I had one idea how such aliases could be avoided. The solution would be to put a new property like this: (put 'yank 'repeat-continue-keys '("y")) (put 'undo 'repeat-continue-keys '("C-/")) Its semantics is that when such a property exists then repeat-mode will check if the last typed keys don't exist in this list, only then the repeat map should be activated. Then bind-keys could put such new properties from the definition like in your example: :continue-only ;; These commands will be available during paragraph manipulation ;; but won't activate paragraph-repeat-map themselves ("y" . yank) ("C-/" . undo) Do you think such a symbol property would cover all possible uses?