From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Dmitry Gutov <dmitry@gutov.dev>
Newsgroups: gmane.emacs.bugs
Subject: bug#66394: 29.1; Make register-read-with-preview more useful
Date: Thu, 14 Dec 2023 04:10:31 +0200
Message-ID: <91460437-4f54-8e35-46a4-86bcbd9a500b@gutov.dev>
References: <87il7ib6cu.fsf@posteo.net> <87h6mcr8ol.fsf@posteo.net>
 <87r0l73029.fsf@web.de> <877cmdx8ud.fsf@posteo.net>
 <jwvjzqcxrnq.fsf-monnier+emacs@gnu.org> <87sf50s1gh.fsf@posteo.net>
 <83o7ficesp.fsf@gnu.org> <878r6leh9d.fsf@posteo.net> <83il5pbnmh.fsf@gnu.org>
 <87zfz1cz7s.fsf@posteo.net> <83bkbc7j1o.fsf@gnu.org>
 <8734wov2wv.fsf@posteo.net> <83v89j6arv.fsf@gnu.org>
 <87cyvpf8y6.fsf@posteo.net> <83plzp82mb.fsf@gnu.org>
 <87a5qhxf05.fsf@posteo.net> <83jzpkvs4z.fsf@gnu.org>
 <87v8947ulo.fsf@posteo.net> <871qbsk5le.fsf@posteo.net>
 <f7f749d1-3a2d-0ea0-a106-6c586f4faca7@gutov.dev> <87v894hr2e.fsf@posteo.net>
 <87cyvbepi0.fsf@posteo.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="2268"; mail-complaints-to="usenet@ciao.gmane.io"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Cc: michael_heerdegen@web.de, Eli Zaretskii <eliz@gnu.org>,
 stefankangas@gmail.com, monnier@iro.umontreal.ca, 66394@debbugs.gnu.org
To: Thierry Volpiatto <thievol@posteo.net>
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 14 03:11:09 2023
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 1rDbBq-0000JI-OB
	for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 14 Dec 2023 03:11:08 +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 1rDbBZ-0006ie-SB; Wed, 13 Dec 2023 21:10:49 -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 1rDbBX-0006hj-Nx
 for bug-gnu-emacs@gnu.org; Wed, 13 Dec 2023 21:10:47 -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 1rDbBW-0000UC-HY
 for bug-gnu-emacs@gnu.org; Wed, 13 Dec 2023 21:10:47 -0500
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1rDbBm-00025d-77
 for bug-gnu-emacs@gnu.org; Wed, 13 Dec 2023 21:11:02 -0500
X-Loop: help-debbugs@gnu.org
Resent-From: Dmitry Gutov <dmitry@gutov.dev>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Thu, 14 Dec 2023 02:11:02 +0000
Resent-Message-ID: <handler.66394.B66394.17025198608027@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 66394
X-GNU-PR-Package: emacs
Original-Received: via spool by 66394-submit@debbugs.gnu.org id=B66394.17025198608027
 (code B ref 66394); Thu, 14 Dec 2023 02:11:02 +0000
Original-Received: (at 66394) by debbugs.gnu.org; 14 Dec 2023 02:11:00 +0000
Original-Received: from localhost ([127.0.0.1]:59955 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1rDbBk-00025P-BN
 for submit@debbugs.gnu.org; Wed, 13 Dec 2023 21:11:00 -0500
Original-Received: from out5-smtp.messagingengine.com ([66.111.4.29]:43587)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dmitry@gutov.dev>) id 1rDbBh-00025A-Ku
 for 66394@debbugs.gnu.org; Wed, 13 Dec 2023 21:10:58 -0500
Original-Received: from compute6.internal (compute6.nyi.internal [10.202.2.47])
 by mailout.nyi.internal (Postfix) with ESMTP id 2F3DD5C04DC;
 Wed, 13 Dec 2023 21:10:36 -0500 (EST)
Original-Received: from mailfrontend1 ([10.202.2.162])
 by compute6.internal (MEProxy); Wed, 13 Dec 2023 21:10:36 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc
 :cc:content-transfer-encoding:content-type:content-type:date
 :date:from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to; s=fm3; t=1702519836;
 x=1702606236; bh=PJS350Ra/G5WINzsCt9/xIwyRBQXo336g2xTE7piGgk=; b=
 me08SAUegbcpt9qB0f1fXKnVzms+PKXVtflkvEj+fZpVaVxqTCl54i9gVDau7/ig
 CQKwP+wMD9Afa55+K4mESWrgyUIsN3emACV1VUtCzd13W/3KORvFVB6oFRigZE1h
 0x7dA+KfMa1BgZVvHOorNhdM/ayU8nOJTt2mjlkHi0RUSZ9dFqH1OX1yp7n/6pj/
 XHdXOXLcGWCmfPS3yd4sKHEaOUimW4lqBBSaBEeHfwxc01p2L8GchBfwZq7Std/E
 QPq8BqANBb6hG01RXNMMR5SZQmKAxsNt2OfSlq4n0Uod2EjqfCEtTD3PUGaY2z49
 ODQ2QjOpDcn3tF4QdDceZQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-transfer-encoding
 :content-type:content-type:date:date:feedback-id:feedback-id
 :from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1702519836; x=
 1702606236; bh=PJS350Ra/G5WINzsCt9/xIwyRBQXo336g2xTE7piGgk=; b=w
 /n2uDLex+NzHmNPdymiVMjC1fzvkLTuN04p37mXSxbl7TG6dWtg1nv/S5sYs1LYi
 4E99powONB3Ypeq0Sc0tcGIjnOkQrzjmJugpj/7vzTHh/WESvOfud5MR4yqXLK6u
 q3Lnhc99Yk84H56MwV3hYA3MjVszuMB30YvPM6+KTuCsWJDczzHxm+Wf08BN7GYo
 CbM36GVY+xNBcKrInKG20eGt7nqbyv3KxCYiue41WM5fJ6mXn5I5YHgpnL1k9cDD
 +dT01zHtz6vIRf4VYsUkTbmyyfueU5wWlAPRpN2Tsd/6aTpULZ2R8ozD7zMm5cDE
 INqMG+p81UP/w7dVmrJ8w==
X-ME-Sender: <xms:G2R6ZYqmrJ8tZ7WZFbnAbElKw_vGAbMoHrSy2y5w3T9hWJwfQOJCqA>
 <xme:G2R6ZeoAUZWNePAfEL6ZI9YbE-k4dTzpj1jdNQKUPYS6I0rqtQIH8LaHJ5aUI7jnj
 GXSqYYu0TFsHap3fTI>
X-ME-Received: <xmr:G2R6ZdP3ZxVytNoWYR7LwPK9DCWw0p74QCaYXusX4Spu8Lt82SMRfM9RmeseyyOExjnuMg>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudelkedggeegucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi
 thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth
 htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel
 vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug
 hmihhtrhihsehguhhtohhvrdguvghv
X-ME-Proxy: <xmx:G2R6Zf6CUzv1TEbg9i0uPpqxZzDejNs60yTarv708eJOccTgxXBecg>
 <xmx:G2R6ZX6-qoyQT0cDMh1CVLrA9L_u2Gv9H6oZ94RVRRGtFl7VspNfzw>
 <xmx:G2R6Zfjr5qxeuDmlhENUR69t8GyZqkG28NmhomnkdvlqdsmcCfET8Q>
 <xmx:HGR6Za1ObMgxpEkYWW50jkjq8s3Jur-4tkN9FaKyZJDppF0aeXoiBw>
Feedback-ID: i0e71465a:Fastmail
Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed,
 13 Dec 2023 21:10:33 -0500 (EST)
Content-Language: en-US
In-Reply-To: <87cyvbepi0.fsf@posteo.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" <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:276169
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/276169>

On 12/12/2023 11:31, Thierry Volpiatto wrote:
> Thierry Volpiatto<thievol@posteo.net>  writes:
> 
>> Dmitry Gutov<dmitry@gutov.dev>  writes:
>>
>>> On 11/12/2023 19:32, Thierry Volpiatto wrote:
>>>> I made a little error in one of the patch when merging from a working
>>>> file for emacs-29.1, attaching here the two patches again with error
>>>> corrected (read `register-use-preview` instead of
>>>> `register-preview-use-preview`), sorry for this.
>>> JFYI, the second patch doesn't apply cleanly, which may make testing
>>> them a bit more difficult.
>>>
>>> It's because of commit 598ab9ca10d35d6 by Eli with documentation
>>> updates. When reverted, the second patch applies without problem.
>> Dmitry thanks, here the patches again after rebasing.
> I found another (merge) error in patch 0001 with defmethod names (read
> register-command-info instead of register-preview-command-info), here
> the patches corrected.  Without this changes, and with
> register-use-preview == nil, confirmation is needed for copy-to-register
> and friends, now fixed.

I did some testing.

Something I'm seeing with my custom config, but not with 'emacs -Q': the 
register preview is eating my windows. :-) No matter if I choose 
something, or C-g out of it.

To reproduce:

(defun split-window-prefer-side-by-side (&optional window)
   (let ((split-height-threshold (and (< (window-width window)
                                         split-width-threshold)
                                      split-height-threshold)))
     (split-window-sensibly window)))

(setq split-window-preferred-function 'split-window-prefer-side-by-side)

Then split the frame horizontally or vertically, create a register and 
jump to it.

The problem is that with this setup the preview is not creating a new 
window but reuses an existing one. And then deletes it at the end.

Again, I'm not a heavy user of registers, so if this is easy enough to 
fix, great. If not, never mind.