From unknown Fri Aug 15 20:52:46 2025 X-Loop: help-debbugs@gnu.org Subject: bug#59626: 29.0.50; [PATCH] comint-fontify-input: Fix field boundary issue Resent-From: miha@kamnitnik.top Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Nov 2022 09:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 59626 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 59626@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.166954096932408 (code B ref -1); Sun, 27 Nov 2022 09:23:02 +0000 Received: (at submit) by debbugs.gnu.org; 27 Nov 2022 09:22:49 +0000 Received: from localhost ([127.0.0.1]:42072 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozDs8-0008Qe-LI for submit@debbugs.gnu.org; Sun, 27 Nov 2022 04:22:48 -0500 Received: from lists.gnu.org ([209.51.188.17]:51820) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozDs7-0008QY-3t for submit@debbugs.gnu.org; Sun, 27 Nov 2022 04:22:47 -0500 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 1ozDs6-00070p-0Q for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 04:22:46 -0500 Received: from kamnitnik.top ([2001:19f0:5001:bf2:5400:2ff:fee0:2626]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozDs3-0000s8-00 for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 04:22:45 -0500 From: miha@kamnitnik.top DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kamnitnik.top; s=mail; t=1669540958; bh=kneFVhhr5E1pQHS7vtTP/baRgUBpLzyamt5Jgo6NYZE=; h=From:To:Subject:Date:From; b=LMdNAUlNa6PrWk5LSEcqyC8c/MUjikjkyKV5eXPYv7OxZ5KQ/vNpEKiVeWD99E8Xh 1mVYuJIiDtUpKZTFTTpxlclAeepYHJz9OHNvcP0g71s+s7Oge6ud+dJNgDLnYwg13g H2mh04AIYyCqmw1FS9C2+NjZxMLP2Ye/SAdNjwbI5IAC27F5hSOZdsRcKiJsbTwHZS vkX8eYg19Ci883ZBR0YXJGWF9TiRajDZAirssW0YSPyU927Zi6HJ2m7yxWjEY3kWnf bBWslqezmPlfrW5hIkufpKs9Mdyy+/cJcBp5FuKOH/EIKrGlWMJ5jdnrqp5SJKkQfn WHw41RpQ8Lgdg== Date: Sun, 27 Nov 2022 10:23:57 +0100 Message-ID: <875yf03g42.fsf@miha-pc> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Received-SPF: pass client-ip=2001:19f0:5001:bf2:5400:2ff:fee0:2626; envelope-from=miha@kamnitnik.top; helo=kamnitnik.top X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FROM_SUSPICIOUS_NTLD=0.001, FROM_SUSPICIOUS_NTLD_FP=1.301, PDS_OTHER_BAD_TLD=1.999, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 2.6 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Please find attached a patch which fixes a minor issue with narrowing to fields during comint input fontification. The issue didn't cause any visible bugs that I know of, I only noticed it during expe [...] Content analysis details: (2.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: kamnitnik.top (top)] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.9 SPF_FAIL SPF: sender does not match SPF record (fail) [SPF failed: Please see http://www.openspf.org/Why?s=mfrom; id=miha%40kamnitnik.top; ip=209.51.188.17; r=debbugs.gnu.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.51.188.17 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [209.51.188.17 listed in list.dnswl.org] 2.0 FROM_SUSPICIOUS_NTLD_FP From abused NTLD 0.0 FROM_SUSPICIOUS_NTLD From abused NTLD 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.4 (/) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Please find attached a patch which fixes a minor issue with narrowing to fields during comint input fontification. The issue didn't cause any visible bugs that I know of, I only noticed it during experimentation with tree-sitter integration. Not that my copyright paperwork renewal is currently in progress, but I hope that the number of lines in this patch fall below the threshold. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-comint-fontify-input-Fix-field-boundary-issue.patch Content-Transfer-Encoding: quoted-printable From=205e2effcaf8d4b1f1cc835fae910e8d85abb7be3c Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Miha=3D20Rihtar=3DC5=3DA1i=3DC4=3D8D?=3D Date: Sat, 26 Nov 2022 23:01:24 +0100 Subject: [PATCH] comint-fontify-input: Fix field boundary issue * lisp/comint.el (comint--intersect-regions): Don't call field-end if we are on a field boundary already. =2D-- lisp/comint.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/comint.el b/lisp/comint.el index ddb3464891..f47e6089f2 100644 =2D-- a/lisp/comint.el +++ b/lisp/comint.el @@ -4122,9 +4122,15 @@ comint--intersect-regions (save-restriction (let ((beg2 beg1) (end2 end1)) =2D (when (=3D beg2 beg) + (when (and (=3D beg2 beg) + (> beg2 (point-min)) + (eq is-output + (eq (get-text-property (1- beg2) 'field) 'outpu= t))) (setq beg2 (field-beginning beg2))) =2D (when (=3D end2 end) + (when (and (=3D end2 end) + (< end2 (point-max)) + (eq is-output + (eq (get-text-property (1+ end2) 'field) 'outpu= t))) (setq end2 (field-end end2))) ;; Narrow to the whole field surrounding the region (narrow-to-region beg2 end2)) =2D-=20 2.38.1 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJHBAEBCAAxFiEEmxVnesoT5rQXvVXnswkaGpIVmT8FAmODLK0THG1paGFAa2Ft bml0bmlrLnRvcAAKCRCzCRoakhWZP59+D/9aywZpt6bMmNYwVAk/cuJBj1terZRW 7CeEIKTzKM3rHzb7Ut0U0z/otdfZI+ZNp95VKVfshSlAHoGmRfTpvIj0qeXwLvO9 LoSl2IfIvZS9XE2Tm7uBtrfdMXsXAkBh4Bo3rLssyMw5lyHriOESEiO5YxUmZTYW xr66HmyMd00ZdtIAL12xoqxAfh0ile++mqlaMrVbvmBpoc1xiM0Z9NVSo55+P3Yf zrD/HbQ4iSCr0w+lBBIICynmXCnH5PV9+YqrFO6KUwBL3z4nX5+Geb3nJkDtBMQq VSzQHl2Hfuz05fQnIt8D0R1R9rXbdzB7rnMBSHhgMscwu5ffBBNDx6GjQp7ja8xG hcMowOyEzPs9CDZ4ehQ31pUs7v8XU8Kc5HKjhRBw1nPlNGkFu4arKW6vuSSDpVsj cC39ejgnmWrx3MqbFmMXeksSCpfQpISGdfMb/xaOh7CkiS8khTlzIP08CXK0pUtk FN62xMeKzBeMPX/EaIjFZ7UOWinkl35Ydo65p0A6c+HCnwcl/tm8Yih6BryHicxF Yi7bwxiUgClv02J5ol3S734K7zE1o+VogHwNX7KO3jbvbVmdbu3pnZZJEa3Gko5T FBZmoQL3xguqzSqtvFR+aGgVxGjlv+v0pIFprMLGtV3ZCm9Y+eWSfyL0mdO+EnEQ tf98UjO3HT3enw== =Lj33 -----END PGP SIGNATURE----- --==-=-=-- From unknown Fri Aug 15 20:52:46 2025 X-Loop: help-debbugs@gnu.org Subject: bug#59626: 29.0.50; [PATCH] comint-fontify-input: Fix field boundary issue Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Nov 2022 09:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59626 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: miha@kamnitnik.top Cc: 59626@debbugs.gnu.org Received: via spool by 59626-submit@debbugs.gnu.org id=B59626.1669541957582 (code B ref 59626); Sun, 27 Nov 2022 09:40:02 +0000 Received: (at 59626) by debbugs.gnu.org; 27 Nov 2022 09:39:17 +0000 Received: from localhost ([127.0.0.1]:42105 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozE85-00009K-4s for submit@debbugs.gnu.org; Sun, 27 Nov 2022 04:39:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55792) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozE80-00009E-C7 for 59626@debbugs.gnu.org; Sun, 27 Nov 2022 04:39:16 -0500 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 1ozE7t-0002nx-T0; Sun, 27 Nov 2022 04:39:05 -0500 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=FyZNYy9K1BCyCm01pn3NhiVIDY/p9o7DiekQCTDntQc=; b=ZghgmCKJcVaO wMPVzvfM9Qkx0gSw3AUAGYKt6uRE1kf8Ft/Noup0TJH8yXmyZ1skafxcFZpW9MoZjSWdtz2PuAtUx 9Z3aC+7Pq20CKNaORlGiroaaRCZRMi8130Awnvlow9Swwyc2vf6r2PViASQoyprlhHQ3ziqhJzFOy eL2+r99pbQ4qCTXNdymLttLX3NuVbA0ZeuEVMpXYNzVH45ogFvSx05wUbtS51vkhmhlUVTd1PJQeU KOKKpr8P6eDbkIRd11y4y/5up0ETGAUjM+RQbScMcjg9bF+zsjBrY3jV35vGuman7YryRITN0AozN BLuQ/aCSjMBz1tr7q9w+qg==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozE7s-0006gK-K0; Sun, 27 Nov 2022 04:39:05 -0500 Date: Sun, 27 Nov 2022 11:39:31 +0200 Message-Id: <83y1rwpwh8.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <875yf03g42.fsf@miha-pc> (bug-gnu-emacs@gnu.org) References: <875yf03g42.fsf@miha-pc> X-Spam-Score: -2.3 (--) 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 (---) > Date: Sun, 27 Nov 2022 10:23:57 +0100 > From: miha--- via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > Please find attached a patch which fixes a minor issue with narrowing to > fields during comint input fontification. The issue didn't cause any > visible bugs that I know of, I only noticed it during experimentation > with tree-sitter integration. Thanks. Do you have a recipe for demonstrating the problem which you are trying to fix? > Not that my copyright paperwork renewal is currently in progress, but I > hope that the number of lines in this patch fall below the threshold. Since when your previous assignment became outdated? I need to know that to make sure the cumulative amount of changes we already received from you doesn't exceed the limit. From unknown Fri Aug 15 20:52:46 2025 X-Loop: help-debbugs@gnu.org Subject: bug#59626: 29.0.50; [PATCH] comint-fontify-input: Fix field boundary issue Resent-From: Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Nov 2022 12:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59626 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: 59626@debbugs.gnu.org Received: via spool by 59626-submit@debbugs.gnu.org id=B59626.16695516957001 (code B ref 59626); Sun, 27 Nov 2022 12:22:01 +0000 Received: (at 59626) by debbugs.gnu.org; 27 Nov 2022 12:21:35 +0000 Received: from localhost ([127.0.0.1]:42223 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozGf9-0001or-BT for submit@debbugs.gnu.org; Sun, 27 Nov 2022 07:21:35 -0500 Received: from kamnitnik.top ([209.250.245.214]:40952) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozGf6-0001ol-UZ for 59626@debbugs.gnu.org; Sun, 27 Nov 2022 07:21:34 -0500 From: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kamnitnik.top; s=mail; t=1669551691; bh=81wShjNHNPagCrytT2CfuNx+3XrMik5cfJgRxWjOV2U=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=xlSrCdx1HYWpySS4xu9KkZyPEqXiXsX06rzdaalUwHbRRhFsSOEF3V3Rn04SK/7mz Z13Iyl0zqugxRCkCtB1IEBvu7tOPNgdyzP3OQy0KB38C8vD3xB/SJDkeQZXri83JsJ mkFh52bw4nC60GbeQUeIU24XP137YW6s1M+X+bBcQ8ytIr9S5yujZmaEF5Tu7XDCjO OucvR+1vc5F6hXQz0XKnC+bYJoQ8aLl7C4WX9Z0X7imbpBpqD9YmfFXOHAn1tIcZOS 0Q7ALVjVRPKiHOozEA40/jFK61rZbwF+d4RA0AVU6gxtbH6k86x0XHmaYI4a7U5D3k kynUxRS3zJqnw== In-Reply-To: <83y1rwpwh8.fsf@gnu.org> References: <875yf03g42.fsf@miha-pc> <83y1rwpwh8.fsf@gnu.org> Date: Sun, 27 Nov 2022 13:22:50 +0100 Message-ID: <8735a437tx.fsf@miha-pc> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Eli Zaretskii writes: >> Date: Sun, 27 Nov 2022 10:23:57 +0100 >> From: miha--- via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >> >> Please find attached a patch which fixe [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: kamnitnik.top (top)] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FROM_SUSPICIOUS_NTLD From abused NTLD 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: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Eli Zaretskii writes: >> Date: Sun, 27 Nov 2022 10:23:57 +0100 >> From: miha--- via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >> >> Please find attached a patch which fixe [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: kamnitnik.top (top)] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 1.0 BULK_RE_SUSP_NTLD Precedence bulk and RE: from a suspicious TLD 0.0 FROM_SUSPICIOUS_NTLD From abused NTLD -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Eli Zaretskii writes: >> Date: Sun, 27 Nov 2022 10:23:57 +0100 >> From: miha--- via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >>=20 >> Please find attached a patch which fixes a minor issue with narrowing to >> fields during comint input fontification. The issue didn't cause any >> visible bugs that I know of, I only noticed it during experimentation >> with tree-sitter integration. > > Thanks. Do you have a recipe for demonstrating the problem which you are > trying to fix? Instrument comint input fontification with this diff: diff --git a/lisp/comint.el b/lisp/comint.el index f47e6089f2..c83da95ad2 100644 =2D-- a/lisp/comint.el +++ b/lisp/comint.el @@ -4083,7 +4083,10 @@ comint--fontify-input-fontify-region nil (lambda (beg end) (unless (get-text-property beg 'comint--fontify-input-inhibit-fontification) =2D (font-lock-fontify-region beg end verbose))) + (font-lock-fontify-region beg end verbose) + ;; Output contents of the visible portion of the + ;; buffer to *Messages*. + (message "%S" (buffer-substring-no-properties (point-mi= n) (point-max))))) beg end))) (`((jit-lock-bounds ,beg1 . ,_) . (jit-lock-bounds ,_ . ,end1)) (setq beg (min beg beg1)) Now open up an M-x shell and type "date RET" into the buffer to make your shell output the current date and an new prompt. Press "C-p C-p C-e" to move point to "date" and change it into "datee". Open up *Messages* and find the following strings: "date" "date " "datee Sun Nov 27 01:05:27 PM CET 2022 ~$ " These strings represent the context in which shell fontification was performed on the input. The last one includes "Sun Nov 27 01:05:27 PM CET 2022\n~$ ", which is a mistake that this patch attempts to fix. However, in pretty much all cases, this didn't result in any user visible inaccuracies, since shell fontification of a command rarely depends on the contents of the lines that follow it. >> Not that my copyright paperwork renewal is currently in progress, but I >> hope that the number of lines in this patch fall below the threshold. > > Since when your previous assignment became outdated? I need to know that= to > make sure the cumulative amount of changes we already received from you > doesn't exceed the limit. 24. of October this year. Thanks, best regards. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJHBAEBCAAxFiEEmxVnesoT5rQXvVXnswkaGpIVmT8FAmODVpoTHG1paGFAa2Ft bml0bmlrLnRvcAAKCRCzCRoakhWZP4vyD/4lhIFK6kKBrScadUHYdVUYcoaqabyh 85a7w+k81cMTwH13O1C6Z0jWlCqCgE6zAvAdsFG7QPYlfeb+D8N2Jgt1AeyZVvVF hUGp/xSopdTeHGL0E8nwVNhU0KPOVkJDUyHeo20WnKWUZzIjw4UCA4hLy6aRVW7M 6i1pTHgmSYxTLE7guMpxs7yt74PY/5fbxfOf/foqfdEqKXoFgKPlIdiU2pJ2s0qw gHiLrFvF005AjkEw3AecQSmTQ9778kjjxIBdDdIokdrpnjodahZGi/VefjkAmT+I zruMmsLd2Uo7rzFkn6O7+ONHfcSxboNJJMejQovA1jmWR2d6saRRX1l1jNzu87VR wpqEclBDJQy8ukKvJPDZp+eDuudrBBLeWUDe0nls8bxYoJIEQhfztJqibBc073B3 8z9O0W4jv9F4q6Mr3zkCrUxFeGboODgL2X/xOrWknYP4UR1xkb2DT3INMctd74po xhEy/U+urePBXssXOJYZqu/Rl5WlCmBm1YjBL2OMF8FjZxfIBRM8CU0Lxh/TnU45 w/vRM/gQyqCNMl4dydgu69LL8q3Di0qZjK9tVwHZM92PjRM4gZHccclVn+Qw4+aO +8CbZxeKC2Ps5Tr+r2+F1yMkpSx62xxj3413zkCIbfTUciyueHYAP4GXSR28g2kt dOOr/JxpMdm+6Q== =/o3k -----END PGP SIGNATURE----- --=-=-=-- From unknown Fri Aug 15 20:52:46 2025 X-Loop: help-debbugs@gnu.org Subject: bug#59626: 29.0.50; [PATCH] comint-fontify-input: Fix field boundary issue Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Nov 2022 12:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59626 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Cc: 59626@debbugs.gnu.org Received: via spool by 59626-submit@debbugs.gnu.org id=B59626.16695520167157 (code B ref 59626); Sun, 27 Nov 2022 12:27:01 +0000 Received: (at 59626) by debbugs.gnu.org; 27 Nov 2022 12:26:56 +0000 Received: from localhost ([127.0.0.1]:42229 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozGkK-0001rN-5C for submit@debbugs.gnu.org; Sun, 27 Nov 2022 07:26:56 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58702) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozGkH-0001rH-Uy for 59626@debbugs.gnu.org; Sun, 27 Nov 2022 07:26:54 -0500 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 1ozGkB-0002HL-Dk; Sun, 27 Nov 2022 07:26:47 -0500 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=ZeX8WdN2oUBD+vMl+0B3bSEfbENdvTOWNBtldoDvYQ4=; b=jX9VibD4sUKp 4QpLrjkKluwRKuPrgwo3wG8e9MYsCtBz3xd0dzniNHuqeDkxYw/0Mpu5xkheVMqyNuTOXVrH3aw6n a+6h9iqUvGLKDMOedIk+4U73gWEz2OG8WPSrk3ahdBTLgUpfPqV9fsIiIDVGwJ1YwBgojlU1xs+kc lwoTzGaW8CNzE325FLKgepkVy1MozKz+u8eTMvW5tJpYfZYnQEy8HDW9SwKH+A5+y1QC8gSDhicMe 4Q8F/CFWzumqPEKwepgxSOrups6oUqxahBf0kED+KvEnNz50dgHglvGRplHrUjtWjPgevxPpQ1Mfj by3JM1+6L8qMr3CUbpPKxg==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozGkA-0006F8-K4; Sun, 27 Nov 2022 07:26:47 -0500 Date: Sun, 27 Nov 2022 14:27:14 +0200 Message-Id: <83r0xopopp.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <8735a437tx.fsf@miha-pc> References: <875yf03g42.fsf@miha-pc> <83y1rwpwh8.fsf@gnu.org> <8735a437tx.fsf@miha-pc> X-Spam-Score: -0.3 (/) 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: -1.3 (-) > From: > Cc: 59626@debbugs.gnu.org > Date: Sun, 27 Nov 2022 13:22:50 +0100 > > > Thanks. Do you have a recipe for demonstrating the problem which you are > > trying to fix? > > Instrument comint input fontification with this diff: > > diff --git a/lisp/comint.el b/lisp/comint.el > index f47e6089f2..c83da95ad2 100644 > --- a/lisp/comint.el > +++ b/lisp/comint.el > @@ -4083,7 +4083,10 @@ comint--fontify-input-fontify-region > nil (lambda (beg end) > (unless (get-text-property > beg 'comint--fontify-input-inhibit-fontification) > - (font-lock-fontify-region beg end verbose))) > + (font-lock-fontify-region beg end verbose) > + ;; Output contents of the visible portion of the > + ;; buffer to *Messages*. > + (message "%S" (buffer-substring-no-properties (point-min) (point-max))))) > beg end))) > (`((jit-lock-bounds ,beg1 . ,_) . (jit-lock-bounds ,_ . ,end1)) > (setq beg (min beg beg1)) > > Now open up an M-x shell and type "date RET" into the buffer to make > your shell output the current date and an new prompt. Press "C-p C-p > C-e" to move point to "date" and change it into "datee". > > Open up *Messages* and find the following strings: > > "date" > > "date > " > > "datee > Sun Nov 27 01:05:27 PM CET 2022 > ~$ " > > These strings represent the context in which shell fontification was > performed on the input. The last one includes "Sun Nov 27 01:05:27 PM > CET 2022\n~$ ", which is a mistake that this patch attempts to fix. > However, in pretty much all cases, this didn't result in any user > visible inaccuracies, since shell fontification of a command rarely > depends on the contents of the lines that follow it. Thanks, I will study this. > >> Not that my copyright paperwork renewal is currently in progress, but I > >> hope that the number of lines in this patch fall below the threshold. > > > > Since when your previous assignment became outdated? I need to know that to > > make sure the cumulative amount of changes we already received from you > > doesn't exceed the limit. > > 24. of October this year. Then it's okay to install this without an assignment (when we decide to install it). From unknown Fri Aug 15 20:52:46 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: miha@kamnitnik.top Subject: bug#59626: closed (Re: bug#59626: 29.0.50; [PATCH] comint-fontify-input: Fix field boundary issue) Message-ID: References: <83ilin43tc.fsf@gnu.org> <875yf03g42.fsf@miha-pc> X-Gnu-PR-Message: they-closed 59626 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 59626@debbugs.gnu.org Date: Wed, 07 Dec 2022 15:45:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1670427903-8163-1" This is a multi-part message in MIME format... ------------=_1670427903-8163-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #59626: 29.0.50; [PATCH] comint-fontify-input: Fix field boundary issue 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 59626@debbugs.gnu.org. --=20 59626: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D59626 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1670427903-8163-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 59626-done) by debbugs.gnu.org; 7 Dec 2022 15:44:09 +0000 Received: from localhost ([127.0.0.1]:50778 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2waf-00026e-1y for submit@debbugs.gnu.org; Wed, 07 Dec 2022 10:44:09 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50308) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2waY-000267-49 for 59626-done@debbugs.gnu.org; Wed, 07 Dec 2022 10:44:07 -0500 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 1p2waR-0003HF-FB; Wed, 07 Dec 2022 10:43:55 -0500 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=vNuEO7nIgfEeEEutbPzdlAdC+ItexNLKofSL8yYwMy8=; b=A41IuI60RtTz KKh/ljML3WzDESQwOUag+os2+NLbHKTuilIt2zdZ5i+ANVzYgNl6W4E9lYuG7Ulh6tNYDUGD1sicY naeOUWjIWKS4aXUNomXDaTKZfeVWEGm0h7iVekvrM3F8WmXmIe0F6YLXhzOjSfkqziK+rO7N0o0zO BFPRFVZljvs8llzOnEE7SdJsJfAa7IfpSpvQTYM1ifT7fe4p9mOBTDsMfCbdQ1z28ZbETJ87uW+P9 Bit9ohgsnTctEdRFUdfy7m6xEsWcFQaFG2gJFBQDVKwS4JlwWrJiwunExB0XKHyeO8jBrMlS/E09r +1DOSed+mdWB1hvbEMWF6Q==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p2waQ-0001MF-Qb; Wed, 07 Dec 2022 10:43:55 -0500 Date: Wed, 07 Dec 2022 17:43:43 +0200 Message-Id: <83ilin43tc.fsf@gnu.org> From: Eli Zaretskii To: miha@kamnitnik.top In-Reply-To: <875yf03g42.fsf@miha-pc> (bug-gnu-emacs@gnu.org) Subject: Re: bug#59626: 29.0.50; [PATCH] comint-fontify-input: Fix field boundary issue References: <875yf03g42.fsf@miha-pc> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 59626-done Cc: 59626-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 (---) > Date: Sun, 27 Nov 2022 10:23:57 +0100 > From: miha--- via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > Please find attached a patch which fixes a minor issue with narrowing to > fields during comint input fontification. The issue didn't cause any > visible bugs that I know of, I only noticed it during experimentation > with tree-sitter integration. > > Not that my copyright paperwork renewal is currently in progress, but I > hope that the number of lines in this patch fall below the threshold. Thanks, installed on the master branch, and closing the bug. ------------=_1670427903-8163-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 27 Nov 2022 09:22:49 +0000 Received: from localhost ([127.0.0.1]:42072 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozDs8-0008Qe-LI for submit@debbugs.gnu.org; Sun, 27 Nov 2022 04:22:48 -0500 Received: from lists.gnu.org ([209.51.188.17]:51820) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozDs7-0008QY-3t for submit@debbugs.gnu.org; Sun, 27 Nov 2022 04:22:47 -0500 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 1ozDs6-00070p-0Q for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 04:22:46 -0500 Received: from kamnitnik.top ([2001:19f0:5001:bf2:5400:2ff:fee0:2626]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozDs3-0000s8-00 for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 04:22:45 -0500 From: miha@kamnitnik.top DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kamnitnik.top; s=mail; t=1669540958; bh=kneFVhhr5E1pQHS7vtTP/baRgUBpLzyamt5Jgo6NYZE=; h=From:To:Subject:Date:From; b=LMdNAUlNa6PrWk5LSEcqyC8c/MUjikjkyKV5eXPYv7OxZ5KQ/vNpEKiVeWD99E8Xh 1mVYuJIiDtUpKZTFTTpxlclAeepYHJz9OHNvcP0g71s+s7Oge6ud+dJNgDLnYwg13g H2mh04AIYyCqmw1FS9C2+NjZxMLP2Ye/SAdNjwbI5IAC27F5hSOZdsRcKiJsbTwHZS vkX8eYg19Ci883ZBR0YXJGWF9TiRajDZAirssW0YSPyU927Zi6HJ2m7yxWjEY3kWnf bBWslqezmPlfrW5hIkufpKs9Mdyy+/cJcBp5FuKOH/EIKrGlWMJ5jdnrqp5SJKkQfn WHw41RpQ8Lgdg== To: bug-gnu-emacs@gnu.org Subject: 29.0.50; [PATCH] comint-fontify-input: Fix field boundary issue Date: Sun, 27 Nov 2022 10:23:57 +0100 Message-ID: <875yf03g42.fsf@miha-pc> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Received-SPF: pass client-ip=2001:19f0:5001:bf2:5400:2ff:fee0:2626; envelope-from=miha@kamnitnik.top; helo=kamnitnik.top X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FROM_SUSPICIOUS_NTLD=0.001, FROM_SUSPICIOUS_NTLD_FP=1.301, PDS_OTHER_BAD_TLD=1.999, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 2.6 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Please find attached a patch which fixes a minor issue with narrowing to fields during comint input fontification. The issue didn't cause any visible bugs that I know of, I only noticed it during expe [...] Content analysis details: (2.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: kamnitnik.top (top)] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.9 SPF_FAIL SPF: sender does not match SPF record (fail) [SPF failed: Please see http://www.openspf.org/Why?s=mfrom; id=miha%40kamnitnik.top; ip=209.51.188.17; r=debbugs.gnu.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.51.188.17 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [209.51.188.17 listed in list.dnswl.org] 2.0 FROM_SUSPICIOUS_NTLD_FP From abused NTLD 0.0 FROM_SUSPICIOUS_NTLD From abused NTLD X-Debbugs-Envelope-To: submit 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.4 (/) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Please find attached a patch which fixes a minor issue with narrowing to fields during comint input fontification. The issue didn't cause any visible bugs that I know of, I only noticed it during experimentation with tree-sitter integration. Not that my copyright paperwork renewal is currently in progress, but I hope that the number of lines in this patch fall below the threshold. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-comint-fontify-input-Fix-field-boundary-issue.patch Content-Transfer-Encoding: quoted-printable From=205e2effcaf8d4b1f1cc835fae910e8d85abb7be3c Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Miha=3D20Rihtar=3DC5=3DA1i=3DC4=3D8D?=3D Date: Sat, 26 Nov 2022 23:01:24 +0100 Subject: [PATCH] comint-fontify-input: Fix field boundary issue * lisp/comint.el (comint--intersect-regions): Don't call field-end if we are on a field boundary already. =2D-- lisp/comint.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/comint.el b/lisp/comint.el index ddb3464891..f47e6089f2 100644 =2D-- a/lisp/comint.el +++ b/lisp/comint.el @@ -4122,9 +4122,15 @@ comint--intersect-regions (save-restriction (let ((beg2 beg1) (end2 end1)) =2D (when (=3D beg2 beg) + (when (and (=3D beg2 beg) + (> beg2 (point-min)) + (eq is-output + (eq (get-text-property (1- beg2) 'field) 'outpu= t))) (setq beg2 (field-beginning beg2))) =2D (when (=3D end2 end) + (when (and (=3D end2 end) + (< end2 (point-max)) + (eq is-output + (eq (get-text-property (1+ end2) 'field) 'outpu= t))) (setq end2 (field-end end2))) ;; Narrow to the whole field surrounding the region (narrow-to-region beg2 end2)) =2D-=20 2.38.1 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJHBAEBCAAxFiEEmxVnesoT5rQXvVXnswkaGpIVmT8FAmODLK0THG1paGFAa2Ft bml0bmlrLnRvcAAKCRCzCRoakhWZP59+D/9aywZpt6bMmNYwVAk/cuJBj1terZRW 7CeEIKTzKM3rHzb7Ut0U0z/otdfZI+ZNp95VKVfshSlAHoGmRfTpvIj0qeXwLvO9 LoSl2IfIvZS9XE2Tm7uBtrfdMXsXAkBh4Bo3rLssyMw5lyHriOESEiO5YxUmZTYW xr66HmyMd00ZdtIAL12xoqxAfh0ile++mqlaMrVbvmBpoc1xiM0Z9NVSo55+P3Yf zrD/HbQ4iSCr0w+lBBIICynmXCnH5PV9+YqrFO6KUwBL3z4nX5+Geb3nJkDtBMQq VSzQHl2Hfuz05fQnIt8D0R1R9rXbdzB7rnMBSHhgMscwu5ffBBNDx6GjQp7ja8xG hcMowOyEzPs9CDZ4ehQ31pUs7v8XU8Kc5HKjhRBw1nPlNGkFu4arKW6vuSSDpVsj cC39ejgnmWrx3MqbFmMXeksSCpfQpISGdfMb/xaOh7CkiS8khTlzIP08CXK0pUtk FN62xMeKzBeMPX/EaIjFZ7UOWinkl35Ydo65p0A6c+HCnwcl/tm8Yih6BryHicxF Yi7bwxiUgClv02J5ol3S734K7zE1o+VogHwNX7KO3jbvbVmdbu3pnZZJEa3Gko5T FBZmoQL3xguqzSqtvFR+aGgVxGjlv+v0pIFprMLGtV3ZCm9Y+eWSfyL0mdO+EnEQ tf98UjO3HT3enw== =Lj33 -----END PGP SIGNATURE----- --==-=-=-- ------------=_1670427903-8163-1--