From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#42424: 27.0.90; replace-match: point is NOT left at the end of replacement Date: Tue, 09 Apr 2024 11:14:35 -0400 Message-ID: References: Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7385"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 42424@debbugs.gnu.org To: Ren Victor Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 09 17:15:29 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 1ruDC5-0001fr-8w for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 09 Apr 2024 17:15:29 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ruDBl-0004kt-Kp; Tue, 09 Apr 2024 11:15:09 -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 1ruDBa-0004eZ-6y for bug-gnu-emacs@gnu.org; Tue, 09 Apr 2024 11:15:03 -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 1ruDBZ-0000h3-4v for bug-gnu-emacs@gnu.org; Tue, 09 Apr 2024 11:14:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ruDBg-0004we-QL for bug-gnu-emacs@gnu.org; Tue, 09 Apr 2024 11:15:04 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Apr 2024 15:15:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42424 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 42424-submit@debbugs.gnu.org id=B42424.171267569918935 (code B ref 42424); Tue, 09 Apr 2024 15:15:04 +0000 Original-Received: (at 42424) by debbugs.gnu.org; 9 Apr 2024 15:14:59 +0000 Original-Received: from localhost ([127.0.0.1]:51248 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruDBa-0004vL-JX for submit@debbugs.gnu.org; Tue, 09 Apr 2024 11:14:58 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:17122) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruDBX-0004u9-OM for 42424@debbugs.gnu.org; Tue, 09 Apr 2024 11:14:57 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 027A01000FC; Tue, 9 Apr 2024 11:14:42 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1712675676; bh=HHs/6tLLATTUqtWvfJre4yIIKZHhn1ht9vZyTBuK4LA=; h=From:To:Cc:Subject:Date:From; b=pWvmyYgffyxCGWxzgGIG0RalIo1FJEiIeizo3Xh1Y7Hve0flsxN/QJAUV8JDjUWfW fQSb0L/XGp4tbmf5BGd4wvmFXEv9qh7nrW5DaCN0k1mzRlY4XvtjdoCo3pqRz1AQsC HzR8d6csK+vOCoH+pK2hfWFgQcMwXNxqfIeTXGWMttZ8cOUCCspxnSfCNmZUKt4zuY oypJyxYj34kQIUwU1GSfpycSJwmlStmLLFDuvPUnF4HS29Mpt+aA3cSAp89mvVEpuL mc9nTVep327cbrhwqsp5QsHKGaOG61pP3QI5Rjz4LhgHtYWru18kk/rw/cMmMoWaUQ GqrnqGqMNKJBQ== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 92C7610004A; Tue, 9 Apr 2024 11:14:36 -0400 (EDT) Original-Received: from pastel (unknown [45.72.201.215]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 753DB120223; Tue, 9 Apr 2024 11:14:36 -0400 (EDT) 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:282998 Archived-At: > This issue happens when modification hooks modify the text before the > end of replacement text. Modification hooks which modify the buffer text are just getting what they deserve. > But the end of replacement might be changed inside of `replace_range'. > So the final movement of point may end up to a wrong place. This is just one of the many problems. > Other types of modification (insert or delete) do not have this issue. > `point' is adjusted before running modification hooks. Yes, occasionally doing bad things won't bite you in the rear. That doesn't justify doing those things. If you want to modify the buffer in response to other buffer modifications, then record this fact in the modification hook and then act on it later, e.g. in a timer. Anything else *will* cause problems sooner or later. Stefan