From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: miha--- via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#59626: 29.0.50; [PATCH] comint-fontify-input: Fix field boundary issue Date: Sun, 27 Nov 2022 13:22:50 +0100 Message-ID: <8735a437tx.fsf@miha-pc> References: <875yf03g42.fsf@miha-pc> <83y1rwpwh8.fsf@gnu.org> Reply-To: Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19884"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 59626@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 27 13:22:27 2022 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 1ozGfz-0004w1-DH for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 27 Nov 2022 13:22:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ozGfh-0007EE-KO; Sun, 27 Nov 2022 07:22:09 -0500 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 1ozGff-0007E4-7t for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 07:22:07 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ozGfe-0001eJ-Rb for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 07:22:06 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ozGfZ-0001p9-Md for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 07:22:01 -0500 X-Loop: help-debbugs@gnu.org 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 Original-Received: via spool by 59626-submit@debbugs.gnu.org id=B59626.16695516957001 (code B ref 59626); Sun, 27 Nov 2022 12:22:01 +0000 Original-Received: (at 59626) by debbugs.gnu.org; 27 Nov 2022 12:21:35 +0000 Original-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 Original-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 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> 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:249203 Archived-At: --=-=-= 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----- --=-=-=--