From unknown Tue Jun 17 22:22:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77816: [PATCH] Fix deleting the first line of calc-trail-mode Resent-From: Wojciech Siewierski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 Apr 2025 04:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 77816 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 77816@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17446922046083 (code B ref -1); Tue, 15 Apr 2025 04:44:02 +0000 Received: (at submit) by debbugs.gnu.org; 15 Apr 2025 04:43:24 +0000 Received: from localhost ([127.0.0.1]:50069 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u4Y8p-0001Zx-Sv for submit@debbugs.gnu.org; Tue, 15 Apr 2025 00:43:24 -0400 Received: from lists.gnu.org ([2001:470:142::17]:45566) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u4NV6-0007pT-U0 for submit@debbugs.gnu.org; Mon, 14 Apr 2025 13:21:41 -0400 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 1u4NUk-0004fT-Jp for bug-gnu-emacs@gnu.org; Mon, 14 Apr 2025 13:21:18 -0400 Received: from mailtransmit05.runbox.com ([2a0c:5a00:149::26]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u4NUa-0005jH-6B for bug-gnu-emacs@gnu.org; Mon, 14 Apr 2025 13:21:18 -0400 Received: from mailtransmit03.runbox ([10.9.9.163] helo=aibo.runbox.com) by mailtransmit05.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1u4NUL-00F3QG-I8 for bug-gnu-emacs@gnu.org; Mon, 14 Apr 2025 19:20:53 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=siewierski.eu; s=selector2; h=Content-Type:MIME-Version:Message-ID:Date: Subject:To:From; bh=xSl8Q/qCxlB/2KgB4C5zWIrPXdwS39M8FEQK1ubrOBQ=; b=SrPXaqDa3 4tQ1+Ny9PipngKqs0lT9bFWWbetoC3EKx4VtLMV1csVFHhBGjx0vv0kBjQO1NJ8Pen4XvVsDY/CAH X0VAWC9EFfea43AnB5hxIXvS83JnpaSspwPfAfDv4uIuFQpsgFIEpMeY6PrVpTOZ/Ht4BMZHH4oOK QSEVN1W6B7YwUIesoZD4jJLGJ9IxrgNIt7pnoXigi+foTBw/XPVnxHKR7J1SGVcRV8k/vR0x8w1fw vRH0aZJWKqLIcMZfupoLVCC4Z5H6UzFZ3Mp//7TssAkj4s95UrhRkKqp7A1asZtut9u60HAIw9JGe X0eX2rX89zYnSWXwHJUoBBvDQ==; Received: from [10.9.9.73] (helo=submission02.runbox) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1u4NUK-0005O0-Lw for bug-gnu-emacs@gnu.org; Mon, 14 Apr 2025 19:20:53 +0200 Received: by submission02.runbox with esmtpsa [Authenticated ID (941579)] (TLS1.2:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) id 1u4NU7-00Erfw-V0 for bug-gnu-emacs@gnu.org; Mon, 14 Apr 2025 19:20:40 +0200 From: Wojciech Siewierski Date: Mon, 14 Apr 2025 19:20:37 +0200 Message-ID: <87wmbmfymy.fsf@bifrost.mail-host-address-is-not-set> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a0c:5a00:149::26; envelope-from=wojciech@siewierski.eu; helo=mailtransmit05.runbox.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Mailman-Approved-At: Tue, 15 Apr 2025 00:43:21 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) --=-=-= Content-Type: text/plain As of GNU Emacs 30.1 it's not possible to delete the first line of the calc trail visible after invoking the Emacs calculator. To reproduce: 1. Start Emacs calc: C-x * c 2. Enter a few numbers: 10 RET 20 RET 30 RET 3. Try deleting the trail lines, repeat for each line: t k Expected behavior: all the trail lines are being deleted. Actual behavior: the first line is still left, no error is reported. This bug was introduced in commit 8e1376a39125c3ffc0484077b502444d853eca79, included since Emacs 28.1. Before that commit, calc trail used its first line as a header, which wasn't meant to be deleted. After migrating to using header-line, the code preserving the first line was kept intact, still preventing the removal of the first line even though it's no longer special. I'm attaching a patch fixing this behavior. Best regards -- Wojciech Siewierski --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Fix-deleting-the-first-line-of-calc-trail-mode.patch >From d3bf63bf78073ed908785d0f1cd2f0095b4338c6 Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Mon, 14 Apr 2025 18:57:28 +0200 Subject: [PATCH] Fix deleting the first line of calc-trail-mode * lisp/calc/calc-trail.el (calc-trail-kill): Remove the check preventing the removal of the first trail line which is no longer relevant since commit 8e1376a3912. --- lisp/calc/calc-trail.el | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lisp/calc/calc-trail.el b/lisp/calc/calc-trail.el index f134a7b16b9..433d3983b12 100644 --- a/lisp/calc/calc-trail.el +++ b/lisp/calc/calc-trail.el @@ -167,14 +167,7 @@ (interactive "p") (calc-with-trail-buffer (let ((buffer-read-only nil)) - (save-restriction - (narrow-to-region ; don't delete "Emacs Trail" header - (save-excursion - (goto-char (point-min)) - (forward-line 1) - (point)) - (point-max)) - (kill-line n))) + (kill-line n)) (calc-trail-here))) (provide 'calc-trail) -- 2.49.0 --=-=-=-- From unknown Tue Jun 17 22:22:27 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Wojciech Siewierski Subject: bug#77816: closed (Re: bug#77816: [PATCH] Fix deleting the first line of calc-trail-mode) Message-ID: References: <86r01thkd0.fsf@gnu.org> <87wmbmfymy.fsf@bifrost.mail-host-address-is-not-set> X-Gnu-PR-Message: they-closed 77816 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 77816@debbugs.gnu.org Date: Tue, 15 Apr 2025 08:59:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1744707542-13489-1" This is a multi-part message in MIME format... ------------=_1744707542-13489-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #77816: [PATCH] Fix deleting the first line of calc-trail-mode which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 77816@debbugs.gnu.org. --=20 77816: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D77816 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1744707542-13489-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 77816-done) by debbugs.gnu.org; 15 Apr 2025 08:58:32 +0000 Received: from localhost ([127.0.0.1]:50598 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u4c7j-0003Uh-OO for submit@debbugs.gnu.org; Tue, 15 Apr 2025 04:58:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45854) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u4c7h-0003UU-Bx for 77816-done@debbugs.gnu.org; Tue, 15 Apr 2025 04:58:29 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u4c7a-0007dv-PJ; Tue, 15 Apr 2025 04:58:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=CYXV8BHeV/tbbQ8JeDCJ3AvRPMm+gjnsytbNpXEq3IA=; b=AfYfE7e/15XS SIY40+eUgit8yynGM5hnAj5qFi5nh2wXrVk8Vw48cbT4PoxiGNmYPXCKGg6EHWe2FGHlGRyNzem6s C1wPOANCA/bhWY3pBF9V3JTn1rqiWDqEeffnuMCvZvGdoNbpbyRIEzXAadY22wVuzzUMsUmOKAoyj RB3McD1Cyd5QpTXmElwcc3hWWBwX5OPD1DfsJsdgPreSygd9exGYpz1IJ4bvD/WtbuGzNZv6y+AU3 gW+UDPBKHKYNODhXCV3nWaTO0FdOyopSZDrihnIiOQrCmSLDdsOEnAbfApmGmi5AuY5JoSHnv+kaD NJOxbVUZrfXRjtjtV/qIdg==; Date: Tue, 15 Apr 2025 11:58:19 +0300 Message-Id: <86r01thkd0.fsf@gnu.org> From: Eli Zaretskii To: Wojciech Siewierski In-Reply-To: <87wmbmfymy.fsf@bifrost.mail-host-address-is-not-set> (message from Wojciech Siewierski on Mon, 14 Apr 2025 19:20:37 +0200) Subject: Re: bug#77816: [PATCH] Fix deleting the first line of calc-trail-mode References: <87wmbmfymy.fsf@bifrost.mail-host-address-is-not-set> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77816-done Cc: 77816-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Wojciech Siewierski > Date: Mon, 14 Apr 2025 19:20:37 +0200 > > As of GNU Emacs 30.1 it's not possible to delete the first line of the > calc trail visible after invoking the Emacs calculator. > > To reproduce: > > 1. Start Emacs calc: C-x * c > 2. Enter a few numbers: 10 RET 20 RET 30 RET > 3. Try deleting the trail lines, repeat for each line: t k > > Expected behavior: all the trail lines are being deleted. > > Actual behavior: the first line is still left, no error is reported. > > This bug was introduced in commit > 8e1376a39125c3ffc0484077b502444d853eca79, included since Emacs 28.1. > Before that commit, calc trail used its first line as a header, which > wasn't meant to be deleted. After migrating to using header-line, the > code preserving the first line was kept intact, still preventing the > removal of the first line even though it's no longer special. > > I'm attaching a patch fixing this behavior. Thanks, I've now installed this on the emacs-30 release branch, and I'm closing this bug. ------------=_1744707542-13489-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 15 Apr 2025 04:43:24 +0000 Received: from localhost ([127.0.0.1]:50069 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u4Y8p-0001Zx-Sv for submit@debbugs.gnu.org; Tue, 15 Apr 2025 00:43:24 -0400 Received: from lists.gnu.org ([2001:470:142::17]:45566) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u4NV6-0007pT-U0 for submit@debbugs.gnu.org; Mon, 14 Apr 2025 13:21:41 -0400 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 1u4NUk-0004fT-Jp for bug-gnu-emacs@gnu.org; Mon, 14 Apr 2025 13:21:18 -0400 Received: from mailtransmit05.runbox.com ([2a0c:5a00:149::26]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u4NUa-0005jH-6B for bug-gnu-emacs@gnu.org; Mon, 14 Apr 2025 13:21:18 -0400 Received: from mailtransmit03.runbox ([10.9.9.163] helo=aibo.runbox.com) by mailtransmit05.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1u4NUL-00F3QG-I8 for bug-gnu-emacs@gnu.org; Mon, 14 Apr 2025 19:20:53 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=siewierski.eu; s=selector2; h=Content-Type:MIME-Version:Message-ID:Date: Subject:To:From; bh=xSl8Q/qCxlB/2KgB4C5zWIrPXdwS39M8FEQK1ubrOBQ=; b=SrPXaqDa3 4tQ1+Ny9PipngKqs0lT9bFWWbetoC3EKx4VtLMV1csVFHhBGjx0vv0kBjQO1NJ8Pen4XvVsDY/CAH X0VAWC9EFfea43AnB5hxIXvS83JnpaSspwPfAfDv4uIuFQpsgFIEpMeY6PrVpTOZ/Ht4BMZHH4oOK QSEVN1W6B7YwUIesoZD4jJLGJ9IxrgNIt7pnoXigi+foTBw/XPVnxHKR7J1SGVcRV8k/vR0x8w1fw vRH0aZJWKqLIcMZfupoLVCC4Z5H6UzFZ3Mp//7TssAkj4s95UrhRkKqp7A1asZtut9u60HAIw9JGe X0eX2rX89zYnSWXwHJUoBBvDQ==; Received: from [10.9.9.73] (helo=submission02.runbox) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1u4NUK-0005O0-Lw for bug-gnu-emacs@gnu.org; Mon, 14 Apr 2025 19:20:53 +0200 Received: by submission02.runbox with esmtpsa [Authenticated ID (941579)] (TLS1.2:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) id 1u4NU7-00Erfw-V0 for bug-gnu-emacs@gnu.org; Mon, 14 Apr 2025 19:20:40 +0200 From: Wojciech Siewierski To: bug-gnu-emacs@gnu.org Subject: [PATCH] Fix deleting the first line of calc-trail-mode Date: Mon, 14 Apr 2025 19:20:37 +0200 Message-ID: <87wmbmfymy.fsf@bifrost.mail-host-address-is-not-set> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a0c:5a00:149::26; envelope-from=wojciech@siewierski.eu; helo=mailtransmit05.runbox.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 15 Apr 2025 00:43:21 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) --=-=-= Content-Type: text/plain As of GNU Emacs 30.1 it's not possible to delete the first line of the calc trail visible after invoking the Emacs calculator. To reproduce: 1. Start Emacs calc: C-x * c 2. Enter a few numbers: 10 RET 20 RET 30 RET 3. Try deleting the trail lines, repeat for each line: t k Expected behavior: all the trail lines are being deleted. Actual behavior: the first line is still left, no error is reported. This bug was introduced in commit 8e1376a39125c3ffc0484077b502444d853eca79, included since Emacs 28.1. Before that commit, calc trail used its first line as a header, which wasn't meant to be deleted. After migrating to using header-line, the code preserving the first line was kept intact, still preventing the removal of the first line even though it's no longer special. I'm attaching a patch fixing this behavior. Best regards -- Wojciech Siewierski --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Fix-deleting-the-first-line-of-calc-trail-mode.patch >From d3bf63bf78073ed908785d0f1cd2f0095b4338c6 Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Mon, 14 Apr 2025 18:57:28 +0200 Subject: [PATCH] Fix deleting the first line of calc-trail-mode * lisp/calc/calc-trail.el (calc-trail-kill): Remove the check preventing the removal of the first trail line which is no longer relevant since commit 8e1376a3912. --- lisp/calc/calc-trail.el | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lisp/calc/calc-trail.el b/lisp/calc/calc-trail.el index f134a7b16b9..433d3983b12 100644 --- a/lisp/calc/calc-trail.el +++ b/lisp/calc/calc-trail.el @@ -167,14 +167,7 @@ (interactive "p") (calc-with-trail-buffer (let ((buffer-read-only nil)) - (save-restriction - (narrow-to-region ; don't delete "Emacs Trail" header - (save-excursion - (goto-char (point-min)) - (forward-line 1) - (point)) - (point-max)) - (kill-line n))) + (kill-line n)) (calc-trail-here))) (provide 'calc-trail) -- 2.49.0 --=-=-=-- ------------=_1744707542-13489-1--