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 10:23:57 +0100 Message-ID: <875yf03g42.fsf@miha-pc> Reply-To: miha@kamnitnik.top 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="39857"; mail-complaints-to="usenet@ciao.gmane.io" To: 59626@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 27 10:23:26 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 1ozDsi-000A6U-Q1 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 27 Nov 2022 10:23:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ozDsa-00073Q-Sv; Sun, 27 Nov 2022 04:23:16 -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 1ozDsZ-00073I-JE for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 04:23:15 -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 1ozDsO-0000sh-IP for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 04:23:15 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ozDsM-0008R9-D1 for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 04:23:02 -0500 X-Loop: help-debbugs@gnu.org 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 X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.166954096932408 (code B ref -1); Sun, 27 Nov 2022 09:23:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 27 Nov 2022 09:22:49 +0000 Original-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 Original-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 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 1ozDs6-00070p-0Q for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 04:22:46 -0500 Original-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 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== 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-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:249191 Archived-At: --==-=-= 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----- --==-=-=--