From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#71525: 30.0.50; Spin in delete-region/interval_deletion_adjustment Spin in delete-region/interval_deletion_adjustment) Date: Fri, 14 Jun 2024 00:47:40 +0300 Message-ID: References: <87y17a55ny.fsf@stebalien.com> <87ikydo246.fsf@stebalien.com> <86o785z8wl.fsf@gnu.org> <87tthwrh8h.fsf@stebalien.com> <867ceszvp1.fsf@gnu.org> <87r0d0rfxa.fsf@stebalien.com> <87bk44bzf4.fsf@stebalien.com> <8634pgztx0.fsf@gnu.org> 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="31071"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: jporterbugs@gmail.com, 71525@debbugs.gnu.org To: Eli Zaretskii , Steven Allen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 13 23:48:33 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 1sHsJ3-0007qk-VT for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 13 Jun 2024 23:48:30 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sHsIe-0008V1-R1; Thu, 13 Jun 2024 17:48:04 -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 1sHsId-0008UU-BI for bug-gnu-emacs@gnu.org; Thu, 13 Jun 2024 17:48: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 1sHsId-0000Xz-3W for bug-gnu-emacs@gnu.org; Thu, 13 Jun 2024 17:48:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sHsIb-0000le-P5 for bug-gnu-emacs@gnu.org; Thu, 13 Jun 2024 17:48:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 13 Jun 2024 21:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71525 X-GNU-PR-Package: emacs Original-Received: via spool by 71525-submit@debbugs.gnu.org id=B71525.17183152722936 (code B ref 71525); Thu, 13 Jun 2024 21:48:01 +0000 Original-Received: (at 71525) by debbugs.gnu.org; 13 Jun 2024 21:47:52 +0000 Original-Received: from localhost ([127.0.0.1]:39370 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sHsIS-0000lH-D7 for submit@debbugs.gnu.org; Thu, 13 Jun 2024 17:47:52 -0400 Original-Received: from fhigh2-smtp.messagingengine.com ([103.168.172.153]:56781) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sHsIP-0000l1-Mf for 71525@debbugs.gnu.org; Thu, 13 Jun 2024 17:47:50 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 8502911400A3; Thu, 13 Jun 2024 17:47:44 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 13 Jun 2024 17:47:44 -0400 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=1718315264; x=1718401664; bh=kMRnByZZSS/sZ3N9rFEEcBCw87BnJJf7S5LahK95wfc=; b= O+pHXOOHRW86EsoIfPxo9TI9ZziAiaVtYQbGs5FwySwZnC1vmxV37cCJXRbFKBj7 +I30sb25aun17sqGUutxOh7wyWAjF1nQvBplb1iUHWJGJgMbhOz7rEmw7hmr8sik q6Mtx4xjBQUSi7avzvaGuCS6A86Fhg9w/YzCoz/mrPJyqT6GrCmWGJCp6UFKqBBV /lMwrY/dstjZlH2m+arE2DZkzjhBUhGxo5j5xr57OMwuNTw2fngB21YVFCgk51p4 2tQMd4eSKSViNdCi9P2RsDXX3YDChtzAYbmtTPzESxIvRqMKXbhEkreGN9MbP9TZ M+bmh+ShjVXuxzZ0KcQdfg== 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=1718315264; x= 1718401664; bh=kMRnByZZSS/sZ3N9rFEEcBCw87BnJJf7S5LahK95wfc=; b=U hYGZfGIOLLm6jw8HMbIAtwJ1O/RQ+6/F7/NY4Wq1irtEPJjoSKP3SdC3Yoww5qY+ Z9hFPv3lEViEDE1KZKUoO0oCY7lo+X6Siv4FvqMq+s6V6sSh5NjsjP6gqpypycXj IKB1PBvKw/xmHZhGdcAmGpkqdvEpCT1yhrRdbG3PLhk+n5Iz0m4FB3rocCCAZEDY r26CHD9oO3XXE91w8HKH8oQbYCzuZyg7UgMwmM+FtkKYM3uf2+veRFtXvSOOSO+H ptgwsmp10nCOORRaMKLII/JqhdOLc3Bvt5BWR8kbdxBSsH2uzp8EeHrBNGkKCPN2 TAq/lS3igndAOm6nqliAg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfedukedgtdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepffeifedvleeukedtgfelieegudfgveekfeejveejffetffeuueeugefhveei uddvnecuffhomhgrihhnpehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 13 Jun 2024 17:47:42 -0400 (EDT) Content-Language: en-US In-Reply-To: <8634pgztx0.fsf@gnu.org> 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:287209 Archived-At: On 13/06/2024 19:31, Eli Zaretskii wrote: >> From: Steven Allen >> Cc:71525@debbugs.gnu.org >> Date: Thu, 13 Jun 2024 09:06:07 -0700 >> >> >> Steven Allen writes: >>> Eli Zaretskii writes: >>>> I see a couple of Eshell-related changes, but no obvious suspects. >>>> >>>> Can someone please reproduce this and post a detailed backtrace, >>>> including Lisp backtrace? Jim, are you looking into this? >>> It's hanging in the C code, not lisp. I believe the issue is: >>> >>> https://lists.gnu.org/archive/html/emacs-devel/2024-06/msg00241.html >>> >>> So I'm trying that patch now. >>> >>> If that doesn't work, I'll produce a backtrace sometime later today. >> I can confirm that the linked patch fixes the issue. Would you still >> like me to produce a backtrace? > No need, thanks. That issue is already on someone's table. I think I see it now. The thing is, decode_coding_c_string already calls adjust_markers_for_insert through decode_coding_object->decode_coding->produce_chars->insert_from_gap And the extra call moves the markers too far. Unfortunately, it's called with BEFORE_MARKERS=nil, and the above call chain makes it difficult to pass through the extra argument. Perhaps we should do this? diff --git a/src/process.c b/src/process.c index eb526311c53..3c6cbe9b188 100644 --- a/src/process.c +++ b/src/process.c @@ -6423,9 +6423,17 @@ read_and_insert_process_output (struct Lisp_Process *p, char *buf, specbind (Qinhibit_modification_hooks, Qt); decode_coding_c_string (process_coding, (unsigned char *) buf, nread, curbuf); - adjust_markers_for_insert (PT, PT_BYTE, - PT + process_coding->produced_char, - PT_BYTE + process_coding->produced, true); + /* The previous call adjusts the markers, except for those + exactly at PT (it inserts with BEFORE_MARKERS=nil). */ + struct Lisp_Marker *m; + for (m = BUF_MARKERS (current_buffer); m; m = m->next) + { + if (m->bytepos == PT_BYTE) + { + m->bytepos = PT_BYTE + process_coding->produced; + m->charpos = PT + process_coding->produced_char; + } + } unbind_to (count1, Qnil); read_process_output_set_last_coding_system (p, process_coding); That doesn't adjust the overlays, however (the adjust_overlays_for_insert call inside adjust_markers_for_insert). And doing the same trick with them seems more difficult.