From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Paul Nelson <ultrono@gmail.com>
Newsgroups: gmane.emacs.bugs
Subject: bug#74140: [PATCH] Add :continue-only directive for repeat maps in
 bind-keys, use-package
Date: Wed, 27 Nov 2024 16:19:01 +0100
Message-ID: <uxsg7twmgon1qy.fsf@gmail.com>
References: <CAOA-32PgrONLtJWnrL=L_fdPaRcakH41egitjYozp6Xheq9WOQ@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="34966"; mail-complaints-to="usenet@ciao.gmane.io"
Cc: 74140@debbugs.gnu.org
To: Juri Linkov <juri@linkov.net>
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 27 16:21:30 2024
Return-path: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>
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 <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>)
	id 1tGJr7-0008vC-Fv
	for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 27 Nov 2024 16:21:29 +0100
Original-Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <bug-gnu-emacs-bounces@gnu.org>)
	id 1tGJql-0007o7-FC; Wed, 27 Nov 2024 10:21: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 <Debian-debbugs@debbugs.gnu.org>)
 id 1tGJqh-0007nj-0l
 for bug-gnu-emacs@gnu.org; Wed, 27 Nov 2024 10:21: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 <Debian-debbugs@debbugs.gnu.org>)
 id 1tGJqg-0006V6-Oj
 for bug-gnu-emacs@gnu.org; Wed, 27 Nov 2024 10:21:02 -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:In-Reply-To:From:To:References:Subject;
 bh=VGQrmhVoDW9vOsY/7d+hOSCH0ON0Fg/jWsdkljqRe+Y=; 
 b=VjHRuKK3oOSB38YmeuAsQAAmiRVP+yniUAnn2xKmIb7V5OG64KXTrKOeG7EmnOfq5uaKBgYtW9L8JthF7wsMQXddDyyOlViJTYK8TFOoemsvhzs5lMND8bvExQzmDH5KkN1sOm52VSptUZBQPtlkykQyq1FmD12e6x6NX2TC5ZhADdCwSZJcXQbExGel/IYgBYRPIM/bdfo0ji7ZdRdGop5dr3gj2azcu2cGpjaaQXqJnVpZhiIuIaa0HksfTlG4fBk6S+cycsvC6FKD1yth3AVpwgNHI4HnEu0qpINXDy1IyuCoeWcTbERz6jlPrUdfh5o92se1JaSgSRNL4H1aBQ==;
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1tGJqg-0002vP-Jo
 for bug-gnu-emacs@gnu.org; Wed, 27 Nov 2024 10:21:02 -0500
X-Loop: help-debbugs@gnu.org
Resent-From: Paul Nelson <ultrono@gmail.com>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Wed, 27 Nov 2024 15:21:02 +0000
Resent-Message-ID: <handler.74140.B74140.173272081111168@debbugs.gnu.org>
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.173272081111168
 (code B ref 74140); Wed, 27 Nov 2024 15:21:02 +0000
Original-Received: (at 74140) by debbugs.gnu.org; 27 Nov 2024 15:20:11 +0000
Original-Received: from localhost ([127.0.0.1]:34280 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1tGJpr-0002u4-7V
 for submit@debbugs.gnu.org; Wed, 27 Nov 2024 10:20:11 -0500
Original-Received: from mail-ej1-f53.google.com ([209.85.218.53]:48458)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ultrono@gmail.com>) id 1tGJpp-0002or-GS
 for 74140@debbugs.gnu.org; Wed, 27 Nov 2024 10:20:09 -0500
Original-Received: by mail-ej1-f53.google.com with SMTP id
 a640c23a62f3a-a9f1c590ecdso1101810266b.1
 for <74140@debbugs.gnu.org>; Wed, 27 Nov 2024 07:20:09 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1732720743; x=1733325543; darn=debbugs.gnu.org;
 h=mime-version:message-id:date:in-reply-to:subject:cc:to:from:from:to
 :cc:subject:date:message-id:reply-to;
 bh=VGQrmhVoDW9vOsY/7d+hOSCH0ON0Fg/jWsdkljqRe+Y=;
 b=NCBhfGJpCHVN2ZCk9dXszaWHGXUTXLko68bsz1n3Enq+LF1aQbWRyO7DoRKS3FEVhO
 3zdIHN9on9s94JBoLngbXe43ZXu5aJkaQ60JatnU1oxCzNSq4toZZbAnis4oHRFMFR8/
 c9que2P+l3zg6qF3M9APKB0t/g9eF+PPNOtt66L9bznui3A4MIh1dW/O/ho8WLdlCSj1
 HYG3O0UPG3jhV724lLLvr61n35P+gbWuQfcEm5ETSSDmuL94PZ7qBoff7irI4SjIIldY
 ZGUDFoF4wiKVhBIkt+Mu6oDMBmu4b868NOX8ZEEeRyUSNMaBX/O4dItTTEn2C4mBQKWQ
 +h/Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1732720743; x=1733325543;
 h=mime-version:message-id:date:in-reply-to:subject:cc:to:from
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=VGQrmhVoDW9vOsY/7d+hOSCH0ON0Fg/jWsdkljqRe+Y=;
 b=ge8k/KmYjbEDIdezu7n/n1mt5gWoecFusYCWTSyG7gPMKORM3SbTkEo3ewYFDKQsMc
 2su/fkBDQgjfwEMQu0KKJJ96CEyB8UjKpGK4nCuBenyunRYtamR7yyQ30XFO4u3txkkE
 twx+bNXempq2b6lci3raH07KZlcbuXbmWm0CZJYs1r0h11oGEJQL+4L0MHP6zUc4OCE8
 pHPENTtPfPV+UZRCwdwRDb2XouRFJEMDHdvgDuCuEk6HWQPla14bRVZe+1mV5ki/X0aN
 JEXt1HawsbwE4fqMWgbJHAWyI4f/cludDp6ZtKQOVJ9lx0P/d9ZAeA7uNYvSsQZiEf45
 4maA==
X-Gm-Message-State: AOJu0YzTU5ZdTqKJ+kjcM8GC7e8iZ3Z8Aui5VCNhMO7sdzeqnB3nsv04
 YIMxq92/QmGMB1ZXZR/5I5CdsSJTWW7o/7i1QnV5CN8b7ZLSTrmo3D8n8l+/fts=
X-Gm-Gg: ASbGncvIXnHf+RdNQ4qZidOpxMWQEFMnd/We1reQr4DGrNw9ZQS2obnY4p4glHa3Elk
 zBi/iblmW6Ar/76M24TyMNmDd0716efzYP41fV3X/mJotOoDgnZkPKhmBNEIU66IT0p+MTl319M
 kEiAd0DR3jEJgw0l7Th00lFHzR9/h88r8WhIgTG9UMShzDu8igu++CJqpE7c+xNGtbrNTO7zlFr
 hKi0aX5YRZdoPgF8Oph/M1wlrmW/Do8ueUMijTu6AT+rUzcnVhNgHrf8YOmbP0n1g+zddoZaeF1
 Bu3ULiRI6jlVlxc=
X-Google-Smtp-Source: AGHT+IEprtUnndssSvO7qrYd4KcN8xV7kdzlqFKsDLU0ilU55r91MpYS2IwERmF5/c6sI+W1FjtLgA==
X-Received: by 2002:a17:906:32cc:b0:aa5:358c:72a7 with SMTP id
 a640c23a62f3a-aa580f1acedmr226628366b.21.1732720743107; 
 Wed, 27 Nov 2024 07:19:03 -0800 (PST)
Original-Received: from localhost (ip-185-104-138-47.ptr.icomera.net. [185.104.138.47])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-aa50b52fcf9sm711930966b.118.2024.11.27.07.19.02
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 27 Nov 2024 07:19:02 -0800 (PST)
In-Reply-To: <87a5dl5daz.fsf@mail.linkov.net> (message from Juri Linkov on
 Wed, 27 Nov 2024 09:46:44 +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" <bug-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-gnu-emacs>
List-Post: <mailto:bug-gnu-emacs@gnu.org>
List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=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:296035
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/296035>

> Thanks for pointing out the case when the command is bound to the same key
> globally and in the repeat map.  So checking for a key can't help here.
>
> Therefore, I implemented another solution in repeat.el.  There is now
> a new symbol property 'repeat-continue-only'.  And a command with this
> symbol property will not activate the repeat map, but will only continue
> the already activated repeating sequence.   This is implemented by
> a simple change:
>
>       (when (and (repeat-check-map map)
>                  (or (null (repeat--command-property 'repeat-continue-only))
>                      was-in-progress))
>

Thanks, I took a look.  One disadvantage of this approach is that it
does not allow the same command to enter one repeat map and continue
another.  I'll confess that I'm not aware of any such examples in my
config, but it still seems like an undesirable "non-local" effect.

This issue motivated my suggestion that the symbol property should be a
list of repeat maps that the command continues, although I haven't
considered the details (e.g., concerning the map vs. the symbol that
points to it) - maybe you have a clearer picture of those.

> BTW, while writing the 'bind-keys' test, I noticed there is no way
> to specify a command that only activates, but not continues
> (the same as :entry in 'defvar-keymap').  Is it true that 'bind-keys'
> has no such keyword, so there is a need to do this explicitly with:
>
>   (put 'repeat-tests-bind-call-a 'repeat-map 'repeat-tests-bind-keys-repeat-map)

Yes, that's also my understanding (but it's not clear to me that it
requires such a keyword if its purpose is to bind keys in a map).