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 19:51:44 +0300 Message-ID: <259d7b05-f1af-4498-9f88-471be8dffc34@gutov.dev> 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> <86v82cxahx.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="34653"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: jporterbugs@gmail.com, steven@stebalien.com, 71525@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 14 18:52:30 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 1sIAA9-0008pB-4z for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 14 Jun 2024 18:52:29 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sIA9k-0006S3-MW; Fri, 14 Jun 2024 12:52: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 1sIA9i-0006RK-TD for bug-gnu-emacs@gnu.org; Fri, 14 Jun 2024 12:52:02 -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 1sIA9i-0007cQ-Ki for bug-gnu-emacs@gnu.org; Fri, 14 Jun 2024 12:52:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sIA9i-0002gu-QF for bug-gnu-emacs@gnu.org; Fri, 14 Jun 2024 12:52:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 14 Jun 2024 16:52:02 +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.171838391610323 (code B ref 71525); Fri, 14 Jun 2024 16:52:02 +0000 Original-Received: (at 71525) by debbugs.gnu.org; 14 Jun 2024 16:51:56 +0000 Original-Received: from localhost ([127.0.0.1]:40841 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sIA9b-0002gR-LL for submit@debbugs.gnu.org; Fri, 14 Jun 2024 12:51:56 -0400 Original-Received: from fhigh6-smtp.messagingengine.com ([103.168.172.157]:52425) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sIA9Z-0002gC-OP for 71525@debbugs.gnu.org; Fri, 14 Jun 2024 12:51:54 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 59B80114014B; Fri, 14 Jun 2024 12:51:48 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 14 Jun 2024 12:51:48 -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=1718383908; x=1718470308; bh=BSdRWm9/GDZsBrOwUoFeH2tZWqEpIbdf0+ULeUu6/gA=; b= UMaqcMvSLvYrYmoSMMorhtvqk5XKpzOXvjMeuc9DP2Ad0g2hQD3r92T/otpgW6dr VM0H12/YW/0KEelbMd3cfbWOHKybB/suEfRnepiGygVCfEcgvUrTNrMKNL5vjPSR 41tDJDtQZ5ar4bxKQeGQQ31U0ZavfGAs2UBTl503f5a7cwmJffxmWhEexOs95V+q 9tStgJePlEO1dooUitgZrI0Rt1UYkYpgvNcWgkcxLFqbWZ/UHAdvKO9zuQhH5+I5 yS8sPYAVAKPqkjY800Q4VRZT0+XDL+hsfGOTt5SNpNi1IJRi579PUabYI+49gvEa OZj8gdtWqo0i3h8YzKtO5Q== 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=1718383908; x= 1718470308; bh=BSdRWm9/GDZsBrOwUoFeH2tZWqEpIbdf0+ULeUu6/gA=; b=B va1c0rhQmpl0FpUvY4pdpw6iaiBaN7GlD5YsvB1Q5fgGKT9PY/9SsozvN23paGs+ Vf7UDaoWOhRkqKfNNVor3J1cpch3pVkZ85EsvvawseUQqrgWp4S5LF9jobLkybHj 7FeqgVrx+7NazSwOYJypVt7ilUSXsDt3BX/1QaOBZLblNZE3rmGLvCTXWgZkRFRM SnvpuF1NbjhlhV8eOuqEr1E2vo7DIU1ew39ltxKWNe3ftbEUlzLcjrHrGPkR7Wq8 JTZDaZu2gZItXqIFqVbXgn68akYtHFCq14Li61sfi9jpaoMrwhQgCi7LFotfGYzf 0izclny7wbWamieZwKaFA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfeduledguddthecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeenucfhrhhomhepffhm ihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrg htthgvrhhnpeetudeljeegheetgfehgeejkeeuhedvveeikeeufedtvddtveefhfdvveeg udejheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 14 Jun 2024 12:51:46 -0400 (EDT) Content-Language: en-US In-Reply-To: <86v82cxahx.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:287232 Archived-At: On 14/06/2024 10:13, Eli Zaretskii wrote: > This is the correct approach, IMO. But see some minor comments below. > >> @@ -7814,7 +7815,7 @@ encode_coding (struct coding_system *coding) >> } while (coding->consumed_char < coding->src_chars); >> >> if (BUFFERP (coding->dst_object) && coding->produced_char > 0) >> - insert_from_gap (coding->produced_char, coding->produced, 0); >> + insert_from_gap (coding->produced_char, coding->produced, 0, coding->dst_before_markers); > Here (and elsewhere in the patch) too-long lines should be broken in > two. > >> + /* True to insert before markers in the DST_OBJECT buffer. */ >> + bool_bf dst_before_markers : 1; > I'd call this 'insert_before_markers' instead. Please also add a > detailed comment here explaining what this flag is for and where and > why used. > >> /* Insert a sequence of NCHARS chars which occupy NBYTES bytes >> starting at GAP_END_ADDR - NBYTES (if text_at_gap_tail) and at >> - GPT_ADDR (if not text_at_gap_tail). */ >> + GPT_ADDR (if not text_at_gap_tail). >> + >> + If BEFORE_MARKERS is true, insert before markers. */ > This commentary should also mention process.c as the single caller > using this facility in unconventional ways. > >> extern void insert_from_gap_1 (ptrdiff_t, ptrdiff_t, bool text_at_gap_tail); >> -extern void insert_from_gap (ptrdiff_t, ptrdiff_t, bool text_at_gap_tail); >> +extern void insert_from_gap (ptrdiff_t, ptrdiff_t, bool text_at_gap_tail, >> + bool before_markers); > We don't have names of arguments in prototypes, only their types. > (Yes, it means the original prototype, and the ones around it, were > also wrong.) > >> --- a/src/process.c >> +++ b/src/process.c >> @@ -6415,6 +6415,7 @@ read_and_insert_process_output (struct Lisp_Process *p, char *buf, >> specpdl_ref count1 = SPECPDL_INDEX (); >> >> XSETBUFFER (curbuf, current_buffer); >> + process_coding->dst_before_markers = true; > Please also add a comment here explaining why this is done. Thanks! I've pushed the amended patch to master, please see how you like the result.