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#45029: 27.1.50; Regression: Yanking into externally modified file with delete-selection-mode Date: Fri, 15 Sep 2023 09:36:12 +0300 Organization: LINKOV.NET Message-ID: <868r986k8n.fsf@mail.linkov.net> References: <581f7e67-db12-ba3a-2354-de8061789861@matholka.se> <87360lnabu.fsf@gnus.org> <83a6uscwv2.fsf@gnu.org> <87eek4gl3p.fsf@mail.linkov.net> <86zg1puupr.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="40551"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: 45029@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 15 08:47:18 2023 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 1qh2bm-000AMC-BL for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 15 Sep 2023 08:47:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qh2bS-0001O1-IK; Fri, 15 Sep 2023 02:46:58 -0400 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 1qh2bQ-0001Nd-Uh for bug-gnu-emacs@gnu.org; Fri, 15 Sep 2023 02:46:56 -0400 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 1qh2bQ-0006tn-Mk for bug-gnu-emacs@gnu.org; Fri, 15 Sep 2023 02:46:56 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qh2bW-0005gQ-KB for bug-gnu-emacs@gnu.org; Fri, 15 Sep 2023 02:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 15 Sep 2023 06:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45029 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed confirmed Original-Received: via spool by 45029-submit@debbugs.gnu.org id=B45029.169476041821829 (code B ref 45029); Fri, 15 Sep 2023 06:47:02 +0000 Original-Received: (at 45029) by debbugs.gnu.org; 15 Sep 2023 06:46:58 +0000 Original-Received: from localhost ([127.0.0.1]:41877 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qh2bS-0005g0-0t for submit@debbugs.gnu.org; Fri, 15 Sep 2023 02:46:58 -0400 Original-Received: from relay1-d.mail.gandi.net ([217.70.183.193]:40211) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qh2bO-0005fY-1W for 45029@debbugs.gnu.org; Fri, 15 Sep 2023 02:46:55 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 55FD3240009; Fri, 15 Sep 2023 06:46:39 +0000 (UTC) In-Reply-To: (Stefan Monnier's message of "Thu, 14 Sep 2023 09:44:00 -0400") 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:270491 Archived-At: >>>> Anyway, here is a patch with two fixes: >>>> 1. Guards read-char-from-minibuffer-insert-char against inadvertent >>>> operating on the non-minibuffer buffer; >>> I suspect this will/would just hide a problem (such as the current one) >>> under the rug. >> I admit this is a workaround, but I have no idea what would be a proper fix. > > The let-binding of `this-command` fixes the problem, doesn't it? But might other uses of a recursive edit break it again? I guess `when (minibufferp)` can't be removed from `read-char-from-minibuffer-insert-other` until all cases below are fixed. >>>> 2. Prevents read-char-from-minibuffer from changing the value of >>>> 'this-command' by read-from-minibuffer: >>> Right, but I think that this needs to apply to all recursive edits >>> rather than only `read-char-from-minibuffer`. >> I tried to test recursive commands at the read-char-from-minibuffer's >> prompt, but can't reproduce the same problem. > > No, I mean other uses of a recursive edit from `pre-command-hook` would > cause the same problem, so the let-binding should be placed deeper than > in `read-char-from-minibuffer`, e.g. inside `recursive_edit_1`. I see, so this problem is more general and not specific to `read-char-from-minibuffer`? It would be nice to find a test case for other commands to confirm that a change in `recursive_edit_1` fixes them.