From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Paul Nelson Newsgroups: gmane.emacs.bugs Subject: bug#74140: [PATCH] Add :continue-only directive for repeat maps in bind-keys, use-package Date: Tue, 5 Nov 2024 21:51:11 +0100 Message-ID: References: <86plnf9xqm.fsf@mail.linkov.net> <87ldxy953e.fsf@mail.linkov.net> <87v7x1edwr.fsf@mail.linkov.net> 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="4073"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 74140@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 05 21:53:30 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 1t8QYL-0000u1-2k for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 05 Nov 2024 21:53:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t8QXx-0005Sh-Su; Tue, 05 Nov 2024 15:53:05 -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 1t8QXv-0005SD-CZ for bug-gnu-emacs@gnu.org; Tue, 05 Nov 2024 15:53: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 1t8QXu-0004Mw-HY for bug-gnu-emacs@gnu.org; Tue, 05 Nov 2024 15:53:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:In-Reply-To:References:MIME-Version:To:Subject; bh=vBdjC/uIfixADvIrS/asFN7JYYwnHgY8lT4BBdgAf4E=; b=CZTuD7ka/V4viW2VI2uERsEuA9AzATx2Ntib26OLi7y8DbtpMDalUGR2xPFR48aqeA++RQkSvwG3/L017U4R9u6WjDz+ppjRrDt6WR6250ziOfzbujtbyIxQD0BPKYWbwiDjCq3eZydOjbV2pbCDeMgHlWuQzlPJpperyO8zKczXQPSGOy3IBoKLgOPW5mw/4m71CJ73ie81lmc3dTtxkr7PgIYRQDEuaarD3mLP8C7sOagIgGvfNyFxoQ6SD+zsSm3hYkRTm6bLpZiG2wtgel/rDIaVVbgQm4fhUV7rYnMwNvO9w4BP4uxD/9njymXTwyBPNnCBJioLEF0Yf19Qmg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t8QXu-0006Dl-C9 for bug-gnu-emacs@gnu.org; Tue, 05 Nov 2024 15:53:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Paul Nelson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Nov 2024 20:53: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.173083994523861 (code B ref 74140); Tue, 05 Nov 2024 20:53:02 +0000 Original-Received: (at 74140) by debbugs.gnu.org; 5 Nov 2024 20:52:25 +0000 Original-Received: from localhost ([127.0.0.1]:38139 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t8QXJ-0006Cm-1V for submit@debbugs.gnu.org; Tue, 05 Nov 2024 15:52:25 -0500 Original-Received: from mail-il1-f182.google.com ([209.85.166.182]:56780) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t8QXG-0006Ce-Um for 74140@debbugs.gnu.org; Tue, 05 Nov 2024 15:52:23 -0500 Original-Received: by mail-il1-f182.google.com with SMTP id e9e14a558f8ab-3a6ace3b6a5so16839255ab.1 for <74140@debbugs.gnu.org>; Tue, 05 Nov 2024 12:52:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730839882; x=1731444682; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=vBdjC/uIfixADvIrS/asFN7JYYwnHgY8lT4BBdgAf4E=; b=mG59CAWgDfgl4AQ1+sg3onKcVzRMhjBVZ1GwuExPAkdCbTzhZT6PJV66t1AOXw3F9/ f9ZC03xi58riMnp0QZwRZmftujj+QjswvUZnIUa4kcLgkpraPjmAgQDyyBqyaL9ScjKY 6IBjsDp5M7KHmSHCvJ4TyiAnP83YhkGvI5IPcIGTm4G9afVQ6G9L5DbvN9bprNqftPGu Mbo+Hz1nquvF6OWfNWRBDaNZvkx8Hb2A+kVte2uB0fzzJ27/s0paVevyQzU9u841x8ew 6YzPWQvs31Kftorl0zvH+yanHJQLaVRasVSnvCq+B4veJgXuIeVkz12tafEs7nemVThP W2Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730839882; x=1731444682; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=vBdjC/uIfixADvIrS/asFN7JYYwnHgY8lT4BBdgAf4E=; b=mf2hWJ/FnNBlGvQnl4YSXvSMMUAKLtJp/8pOwtS/+Mz5nuuFI1DRXOBHtZlELfxRUp DKsM7W3FZLrckDDWjUpzFZvM7r+rzREVRAg0D4AbZTAOW1qllz5sTINNaoR0lqfyESE0 +ghG32vY3l4hDvFzolJ745S4b7yB1Yi1kNmiBlcdq3FuejFD1Z2LVoq2urt0AcG4wiEr EOEbycBe3OtfLSkvffCR3zZ8WMzEBU/zpzbwyRfEz5/kdeTjZpI2rpin4+ObIZPH/UNY V6OpDOPHmxD1yB6xYi0dncM4NRIYHOaOaEXZzGItuipFUwUANbaQTYhiFYiT2v+dQ+Ig SxwA== X-Gm-Message-State: AOJu0YzXhbV60zYYzH/pvLNAXRuWzjvk4NNApRyEqHT/SK+YwMJC9aMM xYonKtYZFBbXmapq+/Nt1wLTYqkgrTbTHv+vyTXT6sWl9NvEvucCLo2KewjIfAqqQYOPzOGsXl8 mYFf0EN4NiiJWM8XeA/0fSO+5Md94r5hZQRc= X-Google-Smtp-Source: AGHT+IFEUrARK1VOm74K6UM2QYPuXvqIRtIMMVm0Mhz1DLmHGyfji4POpe6fvtv5R50TNDTSMFJ3XUWV7OWCxFcyAwY= X-Received: by 2002:a05:6e02:1ca3:b0:3a6:c439:6812 with SMTP id e9e14a558f8ab-3a6c4396b51mr105504385ab.16.1730839882201; Tue, 05 Nov 2024 12:51:22 -0800 (PST) In-Reply-To: <87v7x1edwr.fsf@mail.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:294923 Archived-At: > I see now that the previous idea > was insufficient since it lacks a map. So a better way is to define > a combination of a repeat-map and a key: > > (put 'undo 'repeat-continue-keys '((paragraph-repeat-map . "C-/"))) > > > I guess one alias-free approach would be to introduce a > > repeat-continue property describing keymaps that a command should > > perpetuate, e.g., > > > > (put 'yank 'repeat-continue '(paragraph-repeat-map)) > > (put 'undo 'repeat-continue '(paragraph-repeat-map)) > > Keys are required as well to be able to decide whether > to activate the repeat-map. > I still don't follow. Couldn't we somehow keep track of the active repeat-map (or really, its underlying symbol) and check whether that lies in the provided list? Why should it be necessary to keep track of the key that activated it? In any event, we don't know in advance whether the specific key is the same or different across the keymaps that we do or do not want the command to participate in, so I don't see how knowing the key could be a useful differentiating factor. > There are two possible ways to do this: opt-in and out-out. > > 1. opt-in defines all global keys that activate a repeat-map. e.g.: > > (put 'undo 'repeat-entry-keys '((paragraph-repeat-map . "C-x u"))) > > 2. out-out defines only keys from the repeat-map that should not activate it > by a global key such as the global "u" ('self-insert-command') > should not activate paragraph-repeat-map: > > (put 'undo 'repeat-no-entry-keys '((paragraph-repeat-map . "u"))) What do you have in mind if the user updates the binds in the keymaps?