X-Loop: help-debbugs@HIDDEN Subject: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Thu, 28 Jul 2022 17:30:01 +0000 Resent-Message-ID: <handler.56815.B.165902934717785 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: report 56815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 56815 <at> debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN Received: via spool by submit <at> debbugs.gnu.org id=B.165902934717785 (code B ref -1); Thu, 28 Jul 2022 17:30:01 +0000 Received: (at submit) by debbugs.gnu.org; 28 Jul 2022 17:29:07 +0000 Received: from localhost ([127.0.0.1]:59341 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oH7Jr-0004cl-5u for submit <at> debbugs.gnu.org; Thu, 28 Jul 2022 13:29:07 -0400 Received: from lists.gnu.org ([209.51.188.17]:38442) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1oH7Jo-0004cc-JN for submit <at> debbugs.gnu.org; Thu, 28 Jul 2022 13:29:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47416) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oH7Jo-0008Cx-Ec for bug-gnu-emacs@HIDDEN; Thu, 28 Jul 2022 13:29:04 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52494) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oH7Jo-0004un-5y for bug-gnu-emacs@HIDDEN; Thu, 28 Jul 2022 13:29:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Subject:To:From:Date:mime-version:in-reply-to: references; bh=SKiELSD+E1HmGoiXGAZSpKHtalI0szjkU7F8cgdRCEA=; b=HICSKWR4/Clhhr JDAgZaDnBXoiUXGWJU8/nQe7il6dcmrS+LvT6EvEofcZH0c3tA+oxk6eKNZqX7ABNVlGLvdpj2TmP 8XFhd8JuwMvoSKLoTWSbl/9EZwkCBF2cHPZG4ClZENrudohSDfvdQTDGpOCAyelMmf4pfcfr5NoVB a+DzT+8lweIuAhWXY955upxb4xTHK6PJHTZ8l22Jw4k1PC3w9YFLw/5yNdarck9AFoseXkEjwvAXu n5OVTbHa1OffTDkYau+mtQ/7kW0Lk8xoodyq1tzyGkKZRV8BVyCZfEg9+ny+ZpH+hJS4CE3r9t1Qk ZTsCvfmmgWInj5JwEpog==; Received: from [87.69.77.57] (port=2374 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oH7Jn-0003bi-Ky for bug-gnu-emacs@HIDDEN; Thu, 28 Jul 2022 13:29:04 -0400 Date: Thu, 28 Jul 2022 20:29:13 +0300 Message-Id: <83mtct87ti.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) To reproduce, visit any file with very long lines, turn on truncate-lines, and invoke Isearch. after typing some search string for which there are matches in the buffer, Isearch will highlight many matches that are not visible in the window. In an extreme case where a file has a single very long line, all the matches in the buffer will be highlighted. This both takes long time, and slows down many display-related commands, because the large number of overlays created for the highlighting slows down redisplay. This happens because isearch.el uses window-end as the limit beyond which to stop highlighting, but that is a poor indicator of visibility in buffers under truncate-lines. If isearch.el cannot find a better criterion for stopping highlighting beyond some buffer position, it should at least use some reasonable fixed (or customizable) limit. Another possibility is to turn off lazy-highlight by default when truncate-lines is turned on. This issue is related to poor Emacs performance in buffers with very long lines, and its fix is essential for making Emacs more usable with such buffers. In GNU Emacs 29.0.50 (build 1562, i686-pc-mingw32) of 2022-07-28 built on HOME-C4E4A596F7 Repository revision: 5999dc1cd925ddf8af0b893432124af7904a6918 Repository branch: master Windowing system distributor 'Microsoft Corp.', version 5.1.2600 System Description: Microsoft Windows XP Service Pack 3 (v5.1.0.2600) Configured using: 'configure -C --prefix=/d/usr --with-wide-int --enable-checking=yes,glyphs 'CFLAGS=-O0 -gdwarf-4 -g3'' Configured features: ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXML2 MODULES NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP XPM ZLIB Important settings: value of $LANG: ENU locale-coding-system: cp1255 Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search time-date subr-x mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils rmc iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel dos-w32 ls-lisp disp-table term/w32-win w32-win w32-vars term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads w32notify w32 lcms2 multi-tty make-network-process emacs) Memory information: ((conses 16 42081 12220) (symbols 48 6231 0) (strings 16 16687 2024) (string-bytes 1 454721) (vectors 16 9209) (vector-slots 8 143790 14221) (floats 8 23 45) (intervals 40 268 7) (buffers 888 10))
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Eli Zaretskii <eliz@HIDDEN> Subject: bug#56815: Acknowledgement (29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect) Message-ID: <handler.56815.B.165902934717785.ack <at> debbugs.gnu.org> References: <83mtct87ti.fsf@HIDDEN> X-Gnu-PR-Message: ack 56815 X-Gnu-PR-Package: emacs Reply-To: 56815 <at> debbugs.gnu.org Date: Thu, 28 Jul 2022 17:30:01 +0000 Thank you for filing a new bug report with debbugs.gnu.org. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): bug-gnu-emacs@HIDDEN If you wish to submit further information on this problem, please send it to 56815 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 56815: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D56815 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
X-Loop: help-debbugs@HIDDEN Subject: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect Resent-From: Juri Linkov <juri@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Thu, 28 Jul 2022 20:10:01 +0000 Resent-Message-ID: <handler.56815.B56815.16590389822014 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN> Cc: 56815 <at> debbugs.gnu.org Received: via spool by 56815-submit <at> debbugs.gnu.org id=B56815.16590389822014 (code B ref 56815); Thu, 28 Jul 2022 20:10:01 +0000 Received: (at 56815) by debbugs.gnu.org; 28 Jul 2022 20:09:42 +0000 Received: from localhost ([127.0.0.1]:59452 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oH9pG-0000WQ-Bl for submit <at> debbugs.gnu.org; Thu, 28 Jul 2022 16:09:42 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:36435) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1oH9pF-0000WC-6r for 56815 <at> debbugs.gnu.org; Thu, 28 Jul 2022 16:09:41 -0400 Received: (Authenticated sender: juri@HIDDEN) by mail.gandi.net (Postfix) with ESMTPSA id A52BF240003; Thu, 28 Jul 2022 20:09:34 +0000 (UTC) From: Juri Linkov <juri@HIDDEN> In-Reply-To: <83mtct87ti.fsf@HIDDEN> (Eli Zaretskii's message of "Thu, 28 Jul 2022 20:29:13 +0300") Organization: LINKOV.NET References: <83mtct87ti.fsf@HIDDEN> Date: Thu, 28 Jul 2022 23:08:23 +0300 Message-ID: <865yjhc85k.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) > To reproduce, visit any file with very long lines, turn on > truncate-lines, and invoke Isearch. after typing some search string > for which there are matches in the buffer, Isearch will highlight many > matches that are not visible in the window. In an extreme case where > a file has a single very long line, all the matches in the buffer will > be highlighted. This both takes long time, and slows down many > display-related commands, because the large number of overlays created > for the highlighting slows down redisplay. > > This happens because isearch.el uses window-end as the limit beyond > which to stop highlighting, but that is a poor indicator of visibility > in buffers under truncate-lines. > > If isearch.el cannot find a better criterion for stopping highlighting > beyond some buffer position, it should at least use some reasonable > fixed (or customizable) limit. Another possibility is to turn off > lazy-highlight by default when truncate-lines is turned on. > > This issue is related to poor Emacs performance in buffers with very > long lines, and its fix is essential for making Emacs more usable with > such buffers. I didn't follow the new design of long lines handling. Does it just narrow each long truncated line? When narrowing is in effect then lazy-highlight should already do the right thing since it can't go outside of the narrowed regions.
X-Loop: help-debbugs@HIDDEN Subject: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Fri, 29 Jul 2022 05:51:01 +0000 Resent-Message-ID: <handler.56815.B56815.165907380330751 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov <juri@HIDDEN> Cc: 56815 <at> debbugs.gnu.org Received: via spool by 56815-submit <at> debbugs.gnu.org id=B56815.165907380330751 (code B ref 56815); Fri, 29 Jul 2022 05:51:01 +0000 Received: (at 56815) by debbugs.gnu.org; 29 Jul 2022 05:50:03 +0000 Received: from localhost ([127.0.0.1]:59734 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oHIss-0007zv-M0 for submit <at> debbugs.gnu.org; Fri, 29 Jul 2022 01:50:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46820) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1oHIso-0007zJ-Sl for 56815 <at> debbugs.gnu.org; Fri, 29 Jul 2022 01:50:00 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34312) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oHIsh-0001Ow-Lk; Fri, 29 Jul 2022 01:49:52 -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=FnBg9TX2vlbM7AkuZiYbESYE+xoOeQVj25u3UKzBURY=; b=lQbaxXISmcTY LViHdwEx/RJ8lFt/1/eFh3ByplO3kb7GyvghTguKPEeML1d2b3ZCnPf+OOy1mgmDjdSAY43p5Yy9x NtrT91s89IgB6Bhx6bKS7iX01Jy6qki4Rj5v98b/PZrtol4lYh04B+KGOxKzTRVMWFczpkl7NML25 F98TcEmC1U1B88S5gdcibX4DGSqLygspgW2FO3827i1FRTRGT+zR5tuwkF7TYQtdfhE283VnLybbP EBxU29CTUL9DNIhkWoY3eNbXC3P/uodDSMYycmZo98TVJ1VIc0C3tfsPDlvqxfLkQW4gs5uFg8+Xr cNikXL4dRyROLaUGva6EbA==; Received: from [87.69.77.57] (port=3916 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oHIsg-0005Sw-Jo; Fri, 29 Jul 2022 01:49:51 -0400 Date: Fri, 29 Jul 2022 08:50:02 +0300 Message-Id: <83fsik8o39.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-Reply-To: <865yjhc85k.fsf@HIDDEN> (message from Juri Linkov on Thu, 28 Jul 2022 23:08:23 +0300) References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > From: Juri Linkov <juri@HIDDEN> > Cc: 56815 <at> debbugs.gnu.org > Date: Thu, 28 Jul 2022 23:08:23 +0300 > > > If isearch.el cannot find a better criterion for stopping highlighting > > beyond some buffer position, it should at least use some reasonable > > fixed (or customizable) limit. Another possibility is to turn off > > lazy-highlight by default when truncate-lines is turned on. > > > > This issue is related to poor Emacs performance in buffers with very > > long lines, and its fix is essential for making Emacs more usable with > > such buffers. > > I didn't follow the new design of long lines handling. > Does it just narrow each long truncated line? I don't think it matters, because that narrowing is in effect only as long as redisplay runs. Isearch's lazy-highlight runs off a timer, not from redisplay. I think the main point here is that under truncate-lines, whether a given buffer position is or isn't visible cannot be easily deduced from just its position and the window-end position.
X-Loop: help-debbugs@HIDDEN Subject: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect Resent-From: Lars Ingebrigtsen <larsi@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Fri, 29 Jul 2022 11:50:02 +0000 Resent-Message-ID: <handler.56815.B56815.165909534612385 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN> Cc: 56815 <at> debbugs.gnu.org, Juri Linkov <juri@HIDDEN> Received: via spool by 56815-submit <at> debbugs.gnu.org id=B56815.165909534612385 (code B ref 56815); Fri, 29 Jul 2022 11:50:02 +0000 Received: (at 56815) by debbugs.gnu.org; 29 Jul 2022 11:49:06 +0000 Received: from localhost ([127.0.0.1]:60072 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oHOUM-0003Dh-CC for submit <at> debbugs.gnu.org; Fri, 29 Jul 2022 07:49:06 -0400 Received: from quimby.gnus.org ([95.216.78.240]:42410) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <larsi@HIDDEN>) id 1oHOUK-0003DB-3T for 56815 <at> debbugs.gnu.org; Fri, 29 Jul 2022 07:49:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Agn/NsIki+i1B5u7qXbwXk7I7RghDOyEfMVfn6yUymo=; b=N9Ed5eaxuH2yNbw/CHD/W1sWbs g62Z5n4RytXzullMyhHQTVkwlUHqJqisiKgHO/s8gveBNnvXngHtkylb91WSqfC4p9SYopizTxCYs 7H4ck+zpcYup+u7BlVKYH4Rn/5pKsRKsjJUu93hTIvi9Hgh/ZVo1Ea9i1RDfCIJUCBVY=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <larsi@HIDDEN>) id 1oHOUB-0006Ag-5P; Fri, 29 Jul 2022 13:48:57 +0200 From: Lars Ingebrigtsen <larsi@HIDDEN> In-Reply-To: <83fsik8o39.fsf@HIDDEN> (Eli Zaretskii's message of "Fri, 29 Jul 2022 08:50:02 +0300") References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN> <83fsik8o39.fsf@HIDDEN> X-Now-Playing: Normil Hawaiians's _More Wealth Than Money_: "Return Of Hollow Lands" Date: Fri, 29 Jul 2022 13:48:53 +0200 Message-ID: <87r124kul6.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.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 @@CONTACT_ADDRESS@@ for details. Content preview: This reminds me of something I wondered about when futzing about with inhibiting lazy-highlights w.r.t. text covered by a `display' property (which was fixed a different way): Would it be possibly to make the isearch lazy-highlight just skip the portions of the buffer that aren't visible? Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) This reminds me of something I wondered about when futzing about with inhibiting lazy-highlights w.r.t. text covered by a `display' property (which was fixed a different way): Would it be possibly to make the isearch lazy-highlight just skip the portions of the buffer that aren't visible?
X-Loop: help-debbugs@HIDDEN Subject: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect Resent-From: Juri Linkov <juri@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Fri, 29 Jul 2022 18:19:02 +0000 Resent-Message-ID: <handler.56815.B56815.165911868222693 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Lars Ingebrigtsen <larsi@HIDDEN> Cc: Eli Zaretskii <eliz@HIDDEN>, 56815 <at> debbugs.gnu.org Received: via spool by 56815-submit <at> debbugs.gnu.org id=B56815.165911868222693 (code B ref 56815); Fri, 29 Jul 2022 18:19:02 +0000 Received: (at 56815) by debbugs.gnu.org; 29 Jul 2022 18:18:02 +0000 Received: from localhost ([127.0.0.1]:33421 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oHUYj-0005ti-1P for submit <at> debbugs.gnu.org; Fri, 29 Jul 2022 14:18:01 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:35853) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1oHUYd-0005tM-FW for 56815 <at> debbugs.gnu.org; Fri, 29 Jul 2022 14:18:00 -0400 Received: (Authenticated sender: juri@HIDDEN) by mail.gandi.net (Postfix) with ESMTPSA id 8617020002; Fri, 29 Jul 2022 18:17:45 +0000 (UTC) From: Juri Linkov <juri@HIDDEN> In-Reply-To: <87r124kul6.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Fri, 29 Jul 2022 13:48:53 +0200") Organization: LINKOV.NET References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN> <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN> Date: Fri, 29 Jul 2022 21:14:47 +0300 Message-ID: <86mtcrpyzs.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) > This reminds me of something I wondered about when futzing about with > inhibiting lazy-highlights w.r.t. text covered by a `display' property > (which was fixed a different way): > > Would it be possibly to make the isearch lazy-highlight just skip the > portions of the buffer that aren't visible? Indeed what is worth trying is to add pos-visible-in-window-group-p either to isearch-filter-predicate, or directly to isearch-lazy-highlight-search. Isearch.el already has some uses of pos-visible-in-window-group-p, but currently only in isearch-update.
X-Loop: help-debbugs@HIDDEN Subject: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect Resent-From: Gregory Heytings <gregory@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Fri, 29 Jul 2022 18:38:02 +0000 Resent-Message-ID: <handler.56815.B56815.165911988124717 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov <juri@HIDDEN> Cc: 56815 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi@HIDDEN>, Eli Zaretskii <eliz@HIDDEN> Received: via spool by 56815-submit <at> debbugs.gnu.org id=B56815.165911988124717 (code B ref 56815); Fri, 29 Jul 2022 18:38:02 +0000 Received: (at 56815) by debbugs.gnu.org; 29 Jul 2022 18:38:01 +0000 Received: from localhost ([127.0.0.1]:33448 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oHUs5-0006QX-92 for submit <at> debbugs.gnu.org; Fri, 29 Jul 2022 14:38:01 -0400 Received: from heytings.org ([95.142.160.155]:58074) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <gregory@HIDDEN>) id 1oHUs1-0006QO-4Z for 56815 <at> debbugs.gnu.org; Fri, 29 Jul 2022 14:38:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1659119875; bh=9G3wIYKpHqH9OH/IEtJ00+ekd1lUZmyDYCVP99W48rE=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=TtHRy8A9Mv0mYENnA48rnpQjCZnG+d1b1l75Ysy/pC3KuYX89EQmPiqyAbhkoQKcI MSAWk3Gqsb/2Oc5hpjawWcZPipMKFQGdio5P+pBZyjkrCRmM5myUWiEtBlXZ06tCNJ rekY8I6pcehC3c+zVRp+PifuZ0hgvfykdRlB2lEH+7UW+ElichrOB0IbRyX7pDYz2M cvMq8x/VK7KTGD9LraRrpczjMh3hg30BtG/SRxINpKWI2LyRbIctEIMFkWtVHXjIYA 0DrsM4RwS2UgRFbtlPVD1GbOoRX7H3aZWUEph78/MJrRRERESA0QpLl1+qjLv8RNZU 1/QdGJtUrjhsg== Date: Fri, 29 Jul 2022 18:37:55 +0000 From: Gregory Heytings <gregory@HIDDEN> In-Reply-To: <86mtcrpyzs.fsf@HIDDEN> Message-ID: <bf6b6a6fd369cd74b0fd@HIDDEN> References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN> <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN> <86mtcrpyzs.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) >> Would it be possibly to make the isearch lazy-highlight just skip the >> portions of the buffer that aren't visible? > > Indeed what is worth trying is to add pos-visible-in-window-group-p > either to isearch-filter-predicate, or directly to > isearch-lazy-highlight-search. > That wouldn't work alas. The problem is how "visible" is defined here (by pos-visible-in-window-p). With truncated lines, all buffer positions between window-start and window-end are "visible", or IOW, all buffer positions on the left or right of the actually visible line portion are "visible". Moreover pos-visible-in-window-p is a slow function, so it would be terribly slow to call it for each candidate position in a buffer with (tens of) thousands of candidate positions.
X-Loop: help-debbugs@HIDDEN Subject: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Fri, 29 Jul 2022 19:03:01 +0000 Resent-Message-ID: <handler.56815.B56815.165912132827349 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Gregory Heytings <gregory@HIDDEN> Cc: larsi@HIDDEN, 56815 <at> debbugs.gnu.org, juri@HIDDEN Received: via spool by 56815-submit <at> debbugs.gnu.org id=B56815.165912132827349 (code B ref 56815); Fri, 29 Jul 2022 19:03:01 +0000 Received: (at 56815) by debbugs.gnu.org; 29 Jul 2022 19:02:08 +0000 Received: from localhost ([127.0.0.1]:33458 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oHVFN-000771-Vf for submit <at> debbugs.gnu.org; Fri, 29 Jul 2022 15:02:08 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53586) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1oHVFI-00076T-HN for 56815 <at> debbugs.gnu.org; Fri, 29 Jul 2022 15:02:04 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:46112) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oHVFA-0002QJ-V7; Fri, 29 Jul 2022 15:01:53 -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=nU5DqKVpRfg4GWBef51zA8fiesYJQT+KITtheekTvCc=; b=YTihrS/H50Z3 19yzXI/GviFz+NpVZAxeUrRrfL0IFpF2A63IpTZtyezOscTPonOYpWUwwhWuwnoj803/lE6DlanCp xkRNtUZ1MPcFKg9IVpbP+co6B2j7EFosBC/pUYIZInB8ZlZYQHhRXgjmyCqFwOWHnd4qKhMBcZ0U+ 7Ok+wxlHh23A91cUXmCiNsB8u8Zho7Yvi4jnH5bp/+AndGZSHdC2ak66OwtSAfCXQOMQ9MNJFtgTZ tMZnUSQAQ0PU4oDQubAhx8J3puqqHt1KYq/VejVj4X18DNGESp7VpsG/G41t3oiUbxPb+tTplC6n+ bb4GUO67lpyc9WDhBKhg0g==; Received: from [87.69.77.57] (port=4945 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oHVF7-00041f-Tz; Fri, 29 Jul 2022 15:01:52 -0400 Date: Fri, 29 Jul 2022 22:02:02 +0300 Message-Id: <83bkt77nf9.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-Reply-To: <bf6b6a6fd369cd74b0fd@HIDDEN> (message from Gregory Heytings on Fri, 29 Jul 2022 18:37:55 +0000) References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN> <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN> <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > Date: Fri, 29 Jul 2022 18:37:55 +0000 > From: Gregory Heytings <gregory@HIDDEN> > cc: Lars Ingebrigtsen <larsi@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>, > 56815 <at> debbugs.gnu.org > > > Indeed what is worth trying is to add pos-visible-in-window-group-p > > either to isearch-filter-predicate, or directly to > > isearch-lazy-highlight-search. > > That wouldn't work alas. > > The problem is how "visible" is defined here (by pos-visible-in-window-p). > With truncated lines, all buffer positions between window-start and > window-end are "visible", or IOW, all buffer positions on the left or > right of the actually visible line portion are "visible". One could use posn-at-point instead. > Moreover pos-visible-in-window-p is a slow function, so it would be > terribly slow to call it for each candidate position in a buffer with > (tens of) thousands of candidate positions. I think posn-at-point is much faster, because it never actually looks beyond the right edge of the window (it considers every position beyond the rightmost shown one to be at the edge of the window, either on the right-fringe, if fringes are shown, or at the last_visible_x coordinate).
X-Loop: help-debbugs@HIDDEN Subject: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect Resent-From: Gregory Heytings <gregory@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Fri, 29 Jul 2022 19:12:01 +0000 Resent-Message-ID: <handler.56815.B56815.165912187828318 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN> Cc: larsi@HIDDEN, 56815 <at> debbugs.gnu.org, juri@HIDDEN Received: via spool by 56815-submit <at> debbugs.gnu.org id=B56815.165912187828318 (code B ref 56815); Fri, 29 Jul 2022 19:12:01 +0000 Received: (at 56815) by debbugs.gnu.org; 29 Jul 2022 19:11:18 +0000 Received: from localhost ([127.0.0.1]:33469 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oHVOH-0007Me-NI for submit <at> debbugs.gnu.org; Fri, 29 Jul 2022 15:11:17 -0400 Received: from heytings.org ([95.142.160.155]:58118) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <gregory@HIDDEN>) id 1oHVOC-0007MP-Ok for 56815 <at> debbugs.gnu.org; Fri, 29 Jul 2022 15:11:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1659121870; bh=FMC9hjvkdSljByKGKZTySl5pWSAdVgqqVVS/SLn3QmA=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=82Bb4ht4UzgPXDARz7BrqEZK2pJPqNH8VkOuA+WX0MioyLMQZJyNGgLmNe6c5KcuK UaVMlmPbNTBCXIYUU10FmpZcIfF2o+59Ryej0YbUsfJXKQEW4CI+hzhy+v7760YJG9 59Vg+tACi8mfMIm4hIZ/LOGabKyuh6o4ORcJPGUW6lGUmPZpk7/Pus1O6c6AQFTKRm XZd3/pVUgvDFh1exfAw4CKrxLxQ5/R5NEBtyd5jUBLgd9aWUDetmYlynmVEI6vM3CM taUZwntlXXjt2OcABlHJwueNDmIg6Ua6xesls8bEdtAFHkE4NVeNLoH+v6zbH1WRuN 3Q2NSR+Njn5qw== Date: Fri, 29 Jul 2022 19:11:10 +0000 From: Gregory Heytings <gregory@HIDDEN> In-Reply-To: <83bkt77nf9.fsf@HIDDEN> Message-ID: <bf6b6a6fd31548b3d6c5@HIDDEN> References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN> <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN> <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN> <83bkt77nf9.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) >> The problem is how "visible" is defined here (by >> pos-visible-in-window-p). With truncated lines, all buffer positions >> between window-start and window-end are "visible", or IOW, all buffer >> positions on the left or right of the actually visible line portion are >> "visible". > > One could use posn-at-point instead. > One could, but... >> Moreover pos-visible-in-window-p is a slow function, so it would be >> terribly slow to call it for each candidate position in a buffer with >> (tens of) thousands of candidate positions. > > I think posn-at-point is much faster, > No, it is slower. On my laptop, with long-line.xml and truncate-lines: (benchmark-run 1000 (pos-visible-in-window-p 310000)) takes 4 seconds (benchmark-run 1000 (numberp (cadr (posn-at-point 310000)))) takes 6 seconds
X-Loop: help-debbugs@HIDDEN Subject: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Fri, 29 Jul 2022 19:32:02 +0000 Resent-Message-ID: <handler.56815.B56815.165912308330553 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Gregory Heytings <gregory@HIDDEN> Cc: larsi@HIDDEN, 56815 <at> debbugs.gnu.org, juri@HIDDEN Received: via spool by 56815-submit <at> debbugs.gnu.org id=B56815.165912308330553 (code B ref 56815); Fri, 29 Jul 2022 19:32:02 +0000 Received: (at 56815) by debbugs.gnu.org; 29 Jul 2022 19:31:23 +0000 Received: from localhost ([127.0.0.1]:33484 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oHVhj-0007wj-8J for submit <at> debbugs.gnu.org; Fri, 29 Jul 2022 15:31:23 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58788) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1oHVhi-0007wV-A2 for 56815 <at> debbugs.gnu.org; Fri, 29 Jul 2022 15:31:22 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:46332) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oHVhW-0007Vl-PH; Fri, 29 Jul 2022 15:31:16 -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=ZBKxyOj3P0PJKiClSt/j7Yu5qjk26WyXOMIZX30uV1c=; b=AVIUQA8w0k7Q Z+5q2nBiYLHy29MyEX+t3Cm4V4yDRd+V4KwhDq3kRyfjV/B9rwY0/ytrqSKz7VHpWyReQD/QgK7Lx eh3ujm7kagDZGwbjktpXKg9ihh9I12fkVg7G4xZFH1QKMF2xdHwIgyV+YQkv6TTYgM1LH9UYWInPv fz6xmQc7qd9J7to5ig/BvdhalftOcgnb/uk4ZnLlVYUds9eMfI31zfu7+7ZzUj0HqlfeYD8ccXbJE +RTr539OJ2QDVSugxwEKsD1QW5OBNSShW1FhQoGBQefMsLGmvMY2bsTslJ1SBE4JDlv3z1HtXGnqn U/kNEPHbKasUQrrrxqGaIQ==; Received: from [87.69.77.57] (port=2765 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oHVhW-0007MB-8I; Fri, 29 Jul 2022 15:31:10 -0400 Date: Fri, 29 Jul 2022 22:31:22 +0300 Message-Id: <83a68r7m2d.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-Reply-To: <bf6b6a6fd31548b3d6c5@HIDDEN> (message from Gregory Heytings on Fri, 29 Jul 2022 19:11:10 +0000) References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN> <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN> <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN> <83bkt77nf9.fsf@HIDDEN> <bf6b6a6fd31548b3d6c5@HIDDEN> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > Date: Fri, 29 Jul 2022 19:11:10 +0000 > From: Gregory Heytings <gregory@HIDDEN> > cc: juri@HIDDEN, larsi@HIDDEN, 56815 <at> debbugs.gnu.org > > > I think posn-at-point is much faster, > > > > No, it is slower. On my laptop, with long-line.xml and truncate-lines: > > (benchmark-run 1000 (pos-visible-in-window-p 310000)) takes 4 seconds > > (benchmark-run 1000 (numberp (cadr (posn-at-point 310000)))) takes 6 seconds Why does it matter how long pos-visible-in-window-p takes when it cannot tell whether the position is visible? As for posn-at-point, 6 msec per position is not bad, if we in addition limit the number of matches by some reasonable number, like 100, say. Moreover, isearch.el could use some special-purpose algorithm for looking for visible matches in this case. For example, as soon as posn-at-point tells us a match is to the right of the window's right edge, isearch.el could go to the beginning of the next line and continue from there, instead of checking all the subsequent matches on the same line (with a result that is known in advance). This way, we will probably have even fewer matches, and the search will be faster, except for very large values of hscroll.
X-Loop: help-debbugs@HIDDEN Subject: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Fri, 29 Jul 2022 19:37:01 +0000 Resent-Message-ID: <handler.56815.B56815.165912338131024 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: gregory@HIDDEN Cc: larsi@HIDDEN, 56815 <at> debbugs.gnu.org, juri@HIDDEN Received: via spool by 56815-submit <at> debbugs.gnu.org id=B56815.165912338131024 (code B ref 56815); Fri, 29 Jul 2022 19:37:01 +0000 Received: (at 56815) by debbugs.gnu.org; 29 Jul 2022 19:36:21 +0000 Received: from localhost ([127.0.0.1]:33491 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oHVmX-00084K-1S for submit <at> debbugs.gnu.org; Fri, 29 Jul 2022 15:36:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59548) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1oHVmV-000846-Af for 56815 <at> debbugs.gnu.org; Fri, 29 Jul 2022 15:36:19 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:46778) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oHVmP-0008MM-LZ; Fri, 29 Jul 2022 15:36:13 -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=yEox0ESgEzJxW+91ilq3XMD2sRrnkshQ7qYAtkHtOPE=; b=sfkIBbRw3M4k 7yczkdBFYxU/21ejg/HfTWFj4XOZGOppIv2lua52QGflgbE+6E5PZoz+w+GSWTzPT1mRsOqm9Qj1I OZCzjOmKoqWxAcZQCbIk3QqwH4s9/7ukPGU1bjr69anO4vxPtlz2e6xEXp06yDWVG7qkUGgyKkLok qYVee3R1s4LFeUHTk/+GxzJxQZr9l12Kql9WBVUE5YIYrjj4bgr5GNQcOOlaFhsKDFcJTvxXWugNC 5iO37d8wt2pP27BztgBj4Lu+RrAuNyWrwsLxpL0RnnGe/VIUvLrXpRskweouQdESn7JrkskQiZFsZ Jldkhf2Vu6r+lTpo+dQtCw==; Received: from [87.69.77.57] (port=3076 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oHVmP-000719-5Q; Fri, 29 Jul 2022 15:36:13 -0400 Date: Fri, 29 Jul 2022 22:36:25 +0300 Message-Id: <838rob7lty.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-Reply-To: <83a68r7m2d.fsf@HIDDEN> (message from Eli Zaretskii on Fri, 29 Jul 2022 22:31:22 +0300) References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN> <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN> <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN> <83bkt77nf9.fsf@HIDDEN> <bf6b6a6fd31548b3d6c5@HIDDEN> <83a68r7m2d.fsf@HIDDEN> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > Cc: larsi@HIDDEN, 56815 <at> debbugs.gnu.org, juri@HIDDEN > Date: Fri, 29 Jul 2022 22:31:22 +0300 > From: Eli Zaretskii <eliz@HIDDEN> > > > (benchmark-run 1000 (pos-visible-in-window-p 310000)) takes 4 seconds > > > > (benchmark-run 1000 (numberp (cadr (posn-at-point 310000)))) takes 6 seconds > > Why does it matter how long pos-visible-in-window-p takes when it > cannot tell whether the position is visible? Actually, it can: you just need to call it with the 3rd argument non-nil.
X-Loop: help-debbugs@HIDDEN Subject: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect Resent-From: Gregory Heytings <gregory@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Fri, 29 Jul 2022 19:53:02 +0000 Resent-Message-ID: <handler.56815.B56815.1659124335325 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN> Cc: larsi@HIDDEN, 56815 <at> debbugs.gnu.org, juri@HIDDEN Received: via spool by 56815-submit <at> debbugs.gnu.org id=B56815.1659124335325 (code B ref 56815); Fri, 29 Jul 2022 19:53:02 +0000 Received: (at 56815) by debbugs.gnu.org; 29 Jul 2022 19:52:15 +0000 Received: from localhost ([127.0.0.1]:33512 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oHW1v-000058-Af for submit <at> debbugs.gnu.org; Fri, 29 Jul 2022 15:52:15 -0400 Received: from heytings.org ([95.142.160.155]:58160) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <gregory@HIDDEN>) id 1oHW1q-00004u-5t for 56815 <at> debbugs.gnu.org; Fri, 29 Jul 2022 15:52:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1659124328; bh=VMzWxBSE3pL9R/zQ1TubKP8ze0iGTV3xpEqdgsmF9Xw=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=gSE9H7s6jpbcmzkJEKmkURQaT6BFKcpR6U1odtA4iHFfXyDi2MdBS/ob9Rk5vhWnu 7Zjkg3tS/99zNqnh+NLiwxPs5KZIc8Bqpe8htZd3NxYTHioG2tVkDkxZa4J769Okjg jPcYKaDxiOMNzsGjktvUBvH1PPOy9RNseCywI1W3PJK55V5BtRTTMOqJpb4YjwmOhl 9Odo2glvKiKgDANtE5eo1tqhkAOpn4LG9VaD5EF1OkFp0QtcpX3vOqV5bP4FY3evpU RN9/PHy5xoAfYZ0+CyYs1E+JJGRtyLecQuKI41yhEE9H5Atb4P/qDXc+4H2hto1JL3 BJc5qGQHodN6Q== Date: Fri, 29 Jul 2022 19:52:08 +0000 From: Gregory Heytings <gregory@HIDDEN> In-Reply-To: <83a68r7m2d.fsf@HIDDEN> Message-ID: <bf6b6a6fd3f0eaf40602@HIDDEN> References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN> <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN> <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN> <83bkt77nf9.fsf@HIDDEN> <bf6b6a6fd31548b3d6c5@HIDDEN> <83a68r7m2d.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) > > Moreover, isearch.el could use some special-purpose algorithm for > looking for visible matches in this case. For example, as soon as > posn-at-point tells us a match is to the right of the window's right > edge, isearch.el could go to the beginning of the next line and continue > from there, instead of checking all the subsequent matches on the same > line (with a result that is known in advance). This way, we will > probably have even fewer matches, and the search will be faster, except > for very large values of hscroll. > And you really think it's TRT to add such a special-purpose algorithm for that very specific "long-and-truncated lines" case everywhere in Emacs? Because isearch is just one example, there are many other places where you will similarly need to reduce the portion of the buffer that will be considered by the command to the portion of the buffer that is actually visible on screen.
X-Loop: help-debbugs@HIDDEN Subject: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Fri, 29 Jul 2022 20:00:01 +0000 Resent-Message-ID: <handler.56815.B56815.16591247751056 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Gregory Heytings <gregory@HIDDEN> Cc: larsi@HIDDEN, 56815 <at> debbugs.gnu.org, juri@HIDDEN Received: via spool by 56815-submit <at> debbugs.gnu.org id=B56815.16591247751056 (code B ref 56815); Fri, 29 Jul 2022 20:00:01 +0000 Received: (at 56815) by debbugs.gnu.org; 29 Jul 2022 19:59:35 +0000 Received: from localhost ([127.0.0.1]:33521 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oHW91-0000Gx-Fg for submit <at> debbugs.gnu.org; Fri, 29 Jul 2022 15:59:35 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35616) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1oHW8x-0000Gg-Hp for 56815 <at> debbugs.gnu.org; Fri, 29 Jul 2022 15:59:34 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47636) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oHW8s-0006Lu-3k; Fri, 29 Jul 2022 15:59:26 -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=FbbamkogBNWd863Ks30LYQwidSLL6vV2Ruslc2JxtfA=; b=eK6l3nV+gCNX +/BSSuqi8DRqgsbTJmkHWFJOjK2kV96vFnxc8oM6v9Mv3H2Jg4C28AU+L2Tic3/qrnS3Zuxqlh/mP ykW5UzMIKh9o+lBWjvgY05WIruh07zX8E3aOieinoDwfLcEkn2zFGQZHEzIXED8bHsHW9g3Ij9Djt XBQPZX+pApbd2zugphT6HUD8fkxcFWMGjIIry1Ro+GZnMZ44IRmv0EOq+w6wyNMYpOzQ1C8f+Mg4R xBGNLSo6PhwJuPbodnkWb39cOW2WfG/N+r+b3114KWBPmk7Xl8vqXGGvnhSOoNPbVmXoE9YsaxKax u6TMecR8+oseEMNfxGI7gA==; Received: from [87.69.77.57] (port=4493 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oHW8r-0000C0-IB; Fri, 29 Jul 2022 15:59:25 -0400 Date: Fri, 29 Jul 2022 22:59:38 +0300 Message-Id: <837d3v7kr9.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-Reply-To: <bf6b6a6fd3f0eaf40602@HIDDEN> (message from Gregory Heytings on Fri, 29 Jul 2022 19:52:08 +0000) References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN> <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN> <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN> <83bkt77nf9.fsf@HIDDEN> <bf6b6a6fd31548b3d6c5@HIDDEN> <83a68r7m2d.fsf@HIDDEN> <bf6b6a6fd3f0eaf40602@HIDDEN> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > Date: Fri, 29 Jul 2022 19:52:08 +0000 > From: Gregory Heytings <gregory@HIDDEN> > cc: juri@HIDDEN, larsi@HIDDEN, 56815 <at> debbugs.gnu.org > > > Moreover, isearch.el could use some special-purpose algorithm for > > looking for visible matches in this case. For example, as soon as > > posn-at-point tells us a match is to the right of the window's right > > edge, isearch.el could go to the beginning of the next line and continue > > from there, instead of checking all the subsequent matches on the same > > line (with a result that is known in advance). This way, we will > > probably have even fewer matches, and the search will be faster, except > > for very large values of hscroll. > > And you really think it's TRT to add such a special-purpose algorithm for > that very specific "long-and-truncated lines" case everywhere in Emacs? > Because isearch is just one example, there are many other places where you > will similarly need to reduce the portion of the buffer that will be > considered by the command to the portion of the buffer that is actually > visible on screen. Which other places? In this bug we are talking specifically about isearch.el adding thousands of overlays to a buffer, 99.99% of which are not visible. If there are other features that do something similar, please name them. And yes, if we want truncate-lines to work reasonably well, we need to fix any features which behave silly in that display mode. We will not remove truncate-lines from Emacs, and we will not make it dysfunctional. But let's begin by discovering those features, so that this discussion could be less academical.
X-Loop: help-debbugs@HIDDEN Subject: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect Resent-From: Gregory Heytings <gregory@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Fri, 29 Jul 2022 20:27:01 +0000 Resent-Message-ID: <handler.56815.B56815.16591263673850 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN> Cc: larsi@HIDDEN, 56815 <at> debbugs.gnu.org, juri@HIDDEN Received: via spool by 56815-submit <at> debbugs.gnu.org id=B56815.16591263673850 (code B ref 56815); Fri, 29 Jul 2022 20:27:01 +0000 Received: (at 56815) by debbugs.gnu.org; 29 Jul 2022 20:26:07 +0000 Received: from localhost ([127.0.0.1]:33534 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oHWYh-000102-7c for submit <at> debbugs.gnu.org; Fri, 29 Jul 2022 16:26:07 -0400 Received: from heytings.org ([95.142.160.155]:58232) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <gregory@HIDDEN>) id 1oHWYc-0000ze-HT for 56815 <at> debbugs.gnu.org; Fri, 29 Jul 2022 16:26:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1659126361; bh=jAqm6CAWy3xVQ1SFqwusRfVfTQs9zOCBNEKI3umLzOQ=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=aeY6HVAZXEj6I4DfcexTpyLyLgU4ljTCw0pWayrSjPx5pJ1727+D0apJMLInnxYXz VFehajNInxg+0lHL27S8Uxzku++whe5fGlfIw93APVGIyfPf9fSjdmRbHFBa0sOvx7 qqEFr/CnJpp4s84Ds1w0viIqjpb4+FXY26DHeEYIRpd5u3R3PS2Ugqx1XV6IIzPTx3 yc5F8yPjqpA8ctEEoHhRz1DAMJixlpg7uuqToEHRJF+RIMBmPADp+QWiRm3VTga0TK uqpmlPenGnNHZRuAnhp4dQZzk6QLuvYNGzY5EgYE+IP6DiDcGh4t20JEA+fnorwtcJ r2wGnb9y+oDCw== Date: Fri, 29 Jul 2022 20:26:00 +0000 From: Gregory Heytings <gregory@HIDDEN> In-Reply-To: <837d3v7kr9.fsf@HIDDEN> Message-ID: <bf6b6a6fd35ae2bb3303@HIDDEN> References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN> <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN> <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN> <83bkt77nf9.fsf@HIDDEN> <bf6b6a6fd31548b3d6c5@HIDDEN> <83a68r7m2d.fsf@HIDDEN> <bf6b6a6fd3f0eaf40602@HIDDEN> <837d3v7kr9.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) > > And yes, if we want truncate-lines to work reasonably well, we need to > fix any features which behave silly in that display mode. > If we want truncate-lines to work reasonably well without fixing all such features one-by-one, we need to fix the root cause of that dysfunction, which is not inside these individual features, but is the fact that (- (window-end) (window-start)) is huge. > > We will not remove truncate-lines from Emacs, and we will not make it > dysfunctional. > Nobody is asking or suggesting to remove truncate-lines from Emacs, or to make is dysfunctional. Admitting that it doesn't work together with long lines, which has always been the case, is something entirely different. But I feel you will tell me that I'm pressuring you, so I bow out of this discussion.
X-Loop: help-debbugs@HIDDEN Subject: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sat, 30 Jul 2022 05:36:02 +0000 Resent-Message-ID: <handler.56815.B56815.16591593563581 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Gregory Heytings <gregory@HIDDEN> Cc: larsi@HIDDEN, 56815 <at> debbugs.gnu.org, juri@HIDDEN Received: via spool by 56815-submit <at> debbugs.gnu.org id=B56815.16591593563581 (code B ref 56815); Sat, 30 Jul 2022 05:36:02 +0000 Received: (at 56815) by debbugs.gnu.org; 30 Jul 2022 05:35:56 +0000 Received: from localhost ([127.0.0.1]:33766 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oHf8l-0000vg-Ku for submit <at> debbugs.gnu.org; Sat, 30 Jul 2022 01:35:55 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41172) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1oHf8i-0000vT-15 for 56815 <at> debbugs.gnu.org; Sat, 30 Jul 2022 01:35:53 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58170) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oHf8b-0005wV-IJ; Sat, 30 Jul 2022 01:35:45 -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=+La4uXt5AtJYZCKSa1v0+QyGEgC4fhbND+nNpqXl/qo=; b=FOatl5enBZKc yko5RqWH1P2GY0Q8cNHqAWl46+lskt3oOAf4zCzU0RjzWcgN0uPJdgXMLhJ1PK07aR7aVpIflF8Ni VApvlczws8TxrNJryoTiBWmMvXqxspGqW9xTGfQbzWdiiK+2/HRSDCf/hSthqXtUOW3w/YlL6GcYG Ivm95ZHm5nEgoof9l/6sIvW1rIjPgj2sZFhKEpRpof6ndQ9XiBDFVvS+H2VfnQrAInMsenrKAz5Lr h5Bb2cqKNWXzGADGjmZuaLBsC0fnk+9ATJd57JJR31yuj30wJrf9hirAPCl1zT7p9AzGGunf42QRU c9yWMBWwSnWpcGrAj510cQ==; Received: from [87.69.77.57] (port=3884 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oHf8b-0000kI-0B; Sat, 30 Jul 2022 01:35:45 -0400 Date: Sat, 30 Jul 2022 08:35:58 +0300 Message-Id: <835yjf6u2p.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-Reply-To: <bf6b6a6fd35ae2bb3303@HIDDEN> (message from Gregory Heytings on Fri, 29 Jul 2022 20:26:00 +0000) References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN> <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN> <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN> <83bkt77nf9.fsf@HIDDEN> <bf6b6a6fd31548b3d6c5@HIDDEN> <83a68r7m2d.fsf@HIDDEN> <bf6b6a6fd3f0eaf40602@HIDDEN> <837d3v7kr9.fsf@HIDDEN> <bf6b6a6fd35ae2bb3303@HIDDEN> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > Date: Fri, 29 Jul 2022 20:26:00 +0000 > From: Gregory Heytings <gregory@HIDDEN> > cc: larsi@HIDDEN, 56815 <at> debbugs.gnu.org, juri@HIDDEN > > > And yes, if we want truncate-lines to work reasonably well, we need to > > fix any features which behave silly in that display mode. > > If we want truncate-lines to work reasonably well without fixing all such > features one-by-one, we need to fix the root cause of that dysfunction, > which is not inside these individual features, but is the fact that (- > (window-end) (window-start)) is huge. I'm not convinced that this is the root cause, nor that there is indeed a single cause. So far we have found only one feature where this is true, and even that is only because Isearch uses that particular method of deciding when to produce the highlight overlays. It is true that the narrowing optimizations work less well under truncate-lines, for these reasons, but there are other places where we can make improvements and other methods of doing that. There's no reason to believe that the general issue of long lines can be solved by a small number of changes that narrow the buffer. Whatever is left after that we should try solving by other methods. > > We will not remove truncate-lines from Emacs, and we will not make it > > dysfunctional. > > > > Nobody is asking or suggesting to remove truncate-lines from Emacs, or to > make is dysfunctional. Admitting that it doesn't work together with long > lines, which has always been the case, is something entirely different. I admit that it's a tougher nut that currently is not yet cracked, yes. But if improvements can be made in that mode, we should at least try making them, even if those improvements call for some complications in our code.
X-Loop: help-debbugs@HIDDEN Subject: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect Resent-From: Juri Linkov <juri@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sun, 31 Jul 2022 20:12:02 +0000 Resent-Message-ID: <handler.56815.B56815.165929831215383 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Gregory Heytings <gregory@HIDDEN> Cc: 56815 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>, larsi@HIDDEN Received: via spool by 56815-submit <at> debbugs.gnu.org id=B56815.165929831215383 (code B ref 56815); Sun, 31 Jul 2022 20:12:02 +0000 Received: (at 56815) by debbugs.gnu.org; 31 Jul 2022 20:11:52 +0000 Received: from localhost ([127.0.0.1]:38656 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oIFI0-000403-AT for submit <at> debbugs.gnu.org; Sun, 31 Jul 2022 16:11:52 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:41159) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1oIFHv-0003zl-M2 for 56815 <at> debbugs.gnu.org; Sun, 31 Jul 2022 16:11:51 -0400 Received: (Authenticated sender: juri@HIDDEN) by mail.gandi.net (Postfix) with ESMTPSA id 8EC3C60005; Sun, 31 Jul 2022 20:11:39 +0000 (UTC) From: Juri Linkov <juri@HIDDEN> In-Reply-To: <bf6b6a6fd35ae2bb3303@HIDDEN> (Gregory Heytings's message of "Fri, 29 Jul 2022 20:26:00 +0000") Organization: LINKOV.NET References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN> <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN> <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN> <83bkt77nf9.fsf@HIDDEN> <bf6b6a6fd31548b3d6c5@HIDDEN> <83a68r7m2d.fsf@HIDDEN> <bf6b6a6fd3f0eaf40602@HIDDEN> <837d3v7kr9.fsf@HIDDEN> <bf6b6a6fd35ae2bb3303@HIDDEN> Date: Sun, 31 Jul 2022 22:40:22 +0300 Message-ID: <86fsih5bch.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) >> And yes, if we want truncate-lines to work reasonably well, we need to >> fix any features which behave silly in that display mode. >> > > If we want truncate-lines to work reasonably well without fixing all such > features one-by-one, we need to fix the root cause of that dysfunction, > which is not inside these individual features, but is the fact that (- > (window-end) (window-start)) is huge. Do you think introducing the rectangular narrowing could be a more general fix? We already have rectangular regions generalized as non-contiguous regions. Could non-contiguous narrowing help to restrict the accessible buffer area to the visible screen rectangle?
X-Loop: help-debbugs@HIDDEN Subject: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect Resent-From: Gregory Heytings <gregory@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sun, 31 Jul 2022 21:22:01 +0000 Resent-Message-ID: <handler.56815.B56815.165930246922109 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov <juri@HIDDEN> Cc: 56815 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>, larsi@HIDDEN Received: via spool by 56815-submit <at> debbugs.gnu.org id=B56815.165930246922109 (code B ref 56815); Sun, 31 Jul 2022 21:22:01 +0000 Received: (at 56815) by debbugs.gnu.org; 31 Jul 2022 21:21:09 +0000 Received: from localhost ([127.0.0.1]:38701 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oIGN3-0005kW-GV for submit <at> debbugs.gnu.org; Sun, 31 Jul 2022 17:21:09 -0400 Received: from heytings.org ([95.142.160.155]:60964) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <gregory@HIDDEN>) id 1oIGN1-0005kO-HD for 56815 <at> debbugs.gnu.org; Sun, 31 Jul 2022 17:21:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1659302466; bh=5Mbfwclovb1QNgYe4VUbobj9lANhtIVmx8NiyY2qXTc=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=mYKwG89mbUG38udjpxe5f0UIccr039WEvg3g3zaNyMgKQl2FZkHRsc5L426eQtosS t3WxNfhvzS5ESMyKk8iQUrrvwmZY9OopWiS9bJBIGB4X/6nqvtmmd3rl9QDt6+HFUI kDZAoyHmPZp6lY8Tr0z7o22Zha6kNarZVU9Z3p5rBHl1hCK2MEZjRu0f4UaVekL06b j6BJ6JKP8z7AoRSaV2gcxPn5IwhX96UAN2b3nC6iXR/bnTmPXnpj/FCwEsnYtGOQ2H K1UA4oTREWcTj1ZKeZUW5m3KFJnWMU/XDWNjak5y8/q/F8Qu/zgq6zrUXN8n97829/ MaRCWh21AzzXw== Date: Sun, 31 Jul 2022 21:21:05 +0000 From: Gregory Heytings <gregory@HIDDEN> In-Reply-To: <86fsih5bch.fsf@HIDDEN> Message-ID: <8c7321f2f39cf55a895b@HIDDEN> References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN> <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN> <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN> <83bkt77nf9.fsf@HIDDEN> <bf6b6a6fd31548b3d6c5@HIDDEN> <83a68r7m2d.fsf@HIDDEN> <bf6b6a6fd3f0eaf40602@HIDDEN> <837d3v7kr9.fsf@HIDDEN> <bf6b6a6fd35ae2bb3303@HIDDEN> <86fsih5bch.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) >>> And yes, if we want truncate-lines to work reasonably well, we need to >>> fix any features which behave silly in that display mode. >> >> If we want truncate-lines to work reasonably well without fixing all >> such features one-by-one, we need to fix the root cause of that >> dysfunction, which is not inside these individual features, but is the >> fact that (- (window-end) (window-start)) is huge. > > Do you think introducing the rectangular narrowing could be a more > general fix? We already have rectangular regions generalized as > non-contiguous regions. Could non-contiguous narrowing help to restrict > the accessible buffer area to the visible screen rectangle? > Yes, I think so. But I also think it would be wrong to do that. That would be an enormous change to the code (wherever we use BEGV and ZV we would have to use instead two arrays BEGV[] and ZV[]) for a microscopic use case, and it wouldn't even solve the problem completely, because the largest possible line width is limited to about 200 MB anyway (because its width in pixels is stored in an int).
X-Loop: help-debbugs@HIDDEN Subject: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Mon, 01 Aug 2022 11:53:02 +0000 Resent-Message-ID: <handler.56815.B56815.16593547412652 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov <juri@HIDDEN> Cc: 56815 <at> debbugs.gnu.org, gregory@HIDDEN, larsi@HIDDEN Received: via spool by 56815-submit <at> debbugs.gnu.org id=B56815.16593547412652 (code B ref 56815); Mon, 01 Aug 2022 11:53:02 +0000 Received: (at 56815) by debbugs.gnu.org; 1 Aug 2022 11:52:21 +0000 Received: from localhost ([127.0.0.1]:39505 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oITy9-0000gi-FD for submit <at> debbugs.gnu.org; Mon, 01 Aug 2022 07:52:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53090) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1oITy7-0000gV-QY for 56815 <at> debbugs.gnu.org; Mon, 01 Aug 2022 07:52:20 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47306) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oITy2-0000z9-0q; Mon, 01 Aug 2022 07:52:14 -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=QgQAkI9P6JKFcafyqj3B0ERgZncd1g0hmaaW2ininPs=; b=gEyq3GK4lAB7 fWugBNrV3RNsKnYDdAuLakoysgUkjAf4xonRVxtialBFA2nm/iyRFkR0cthPXO6VZka/JvBxigqat yC6FK4KCQKo2rPekYmWoD6dgmELwrPSPenfNFpUGGGXE7e5WMMghOmLYjTWxIty/eohAWgo0AXFwQ phb2ZyLF5XNdtNsSPxHoBw6VaE8sO1YwvkiW6ixNcgpxeojyHA/0TcCJVbJCknIMY9IhZEoAXAnkA MaSTL2sLZsIwD+/2+D0jECEkiPzywDjo58tRa8dr7211eVIg3pfdwy7XmDx1ExlhVAEkEgeQopb7f +ds5Rx/xRIZKZh9rN/dDuA==; Received: from [87.69.77.57] (port=1281 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oITxu-0003jp-Rw; Mon, 01 Aug 2022 07:52:13 -0400 Date: Mon, 01 Aug 2022 14:51:56 +0300 Message-Id: <83wnbs2nc3.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-Reply-To: <86fsih5bch.fsf@HIDDEN> (message from Juri Linkov on Sun, 31 Jul 2022 22:40:22 +0300) References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN> <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN> <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN> <83bkt77nf9.fsf@HIDDEN> <bf6b6a6fd31548b3d6c5@HIDDEN> <83a68r7m2d.fsf@HIDDEN> <bf6b6a6fd3f0eaf40602@HIDDEN> <837d3v7kr9.fsf@HIDDEN> <bf6b6a6fd35ae2bb3303@HIDDEN> <86fsih5bch.fsf@HIDDEN> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > From: Juri Linkov <juri@HIDDEN> > Cc: Eli Zaretskii <eliz@HIDDEN>, larsi@HIDDEN, 56815 <at> debbugs.gnu.org > Date: Sun, 31 Jul 2022 22:40:22 +0300 > > >> And yes, if we want truncate-lines to work reasonably well, we need to > >> fix any features which behave silly in that display mode. > >> > > > > If we want truncate-lines to work reasonably well without fixing all such > > features one-by-one, we need to fix the root cause of that dysfunction, > > which is not inside these individual features, but is the fact that (- > > (window-end) (window-start)) is huge. > > Do you think introducing the rectangular narrowing could be a more general fix? > We already have rectangular regions generalized as non-contiguous regions. > Could non-contiguous narrowing help to restrict the accessible buffer area > to the visible screen rectangle? I don't understand how such a restriction will work on the level of buffer text. E.g., what happens when you insert a single character before the beginning of one of the narrowed regions? does the region move with the text or does it stay on the same buffer positions? Basically, as long as Emacs represents buffer text as a single long C string (aside of the gap), with no additional structure, I don't see how implement this with any reasonable complexity. And I agree with Gregory that the gains in this case will be too low, relative to the complexity. Let's keep this in its correct proportions: we "just" want isearch to behave reasonably well in long-and-truncated lines, because IMO isearch is one of the few features that we cannot break or disable in such buffers -- the ability to search is too fundamental to editing, even if that editing means just viewing the text. So if no good ideas arise that are simple enough to implement, I'm okay with simply disabling isearch-lazy-highlight in such buffers, as I wrote in the original bug report. (Doing that will probably require exposing the "long-lines" flag to Lisp, but that's fine by me.) Thanks.
X-Loop: help-debbugs@HIDDEN Subject: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect Resent-From: Juri Linkov <juri@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Mon, 01 Aug 2022 18:18:02 +0000 Resent-Message-ID: <handler.56815.B56815.16593778528039 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN> Cc: 56815 <at> debbugs.gnu.org, gregory@HIDDEN, larsi@HIDDEN Received: via spool by 56815-submit <at> debbugs.gnu.org id=B56815.16593778528039 (code B ref 56815); Mon, 01 Aug 2022 18:18:02 +0000 Received: (at 56815) by debbugs.gnu.org; 1 Aug 2022 18:17:32 +0000 Received: from localhost ([127.0.0.1]:41605 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oIZyu-00025Z-A9 for submit <at> debbugs.gnu.org; Mon, 01 Aug 2022 14:17:32 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:58479) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1oIZys-000257-TT for 56815 <at> debbugs.gnu.org; Mon, 01 Aug 2022 14:17:31 -0400 Received: (Authenticated sender: juri@HIDDEN) by mail.gandi.net (Postfix) with ESMTPSA id 15029100006; Mon, 1 Aug 2022 18:17:20 +0000 (UTC) From: Juri Linkov <juri@HIDDEN> In-Reply-To: <83wnbs2nc3.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 01 Aug 2022 14:51:56 +0300") Organization: LINKOV.NET References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN> <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN> <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN> <83bkt77nf9.fsf@HIDDEN> <bf6b6a6fd31548b3d6c5@HIDDEN> <83a68r7m2d.fsf@HIDDEN> <bf6b6a6fd3f0eaf40602@HIDDEN> <837d3v7kr9.fsf@HIDDEN> <bf6b6a6fd35ae2bb3303@HIDDEN> <86fsih5bch.fsf@HIDDEN> <83wnbs2nc3.fsf@HIDDEN> Date: Mon, 01 Aug 2022 21:09:05 +0300 Message-ID: <86y1w7bzum.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) > So if no good ideas arise that are simple enough to implement, I'm > okay with simply disabling isearch-lazy-highlight in such buffers, as > I wrote in the original bug report. (Doing that will probably require > exposing the "long-lines" flag to Lisp, but that's fine by me.) Exposing the "long-lines" flag to Lisp is exactly what is needed. So when lazy-highlight will detect a special value of a new buffer-local variable when narrowing is in effect due to long lines, then lazy-highlight can switch to a different algorithm like you described earlier. Currently isearch-lazy-highlight-new-loop checks for window-group-start and window-group-end. But when the "long-lines" flag is set, it should also check for window-hscroll because narrowed lazy-highlighting should be updated on hscrolling. This "long-lines" flag will be also useful for pre-command-hook and post-command-hook to convey the information about narrowing to hooks.
X-Loop: help-debbugs@HIDDEN Subject: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect Resent-From: Gregory Heytings <gregory@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Tue, 02 Aug 2022 07:32:03 +0000 Resent-Message-ID: <handler.56815.B56815.16594254818274 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov <juri@HIDDEN> Cc: larsi@HIDDEN, Eli Zaretskii <eliz@HIDDEN>, 56815 <at> debbugs.gnu.org Received: via spool by 56815-submit <at> debbugs.gnu.org id=B56815.16594254818274 (code B ref 56815); Tue, 02 Aug 2022 07:32:03 +0000 Received: (at 56815) by debbugs.gnu.org; 2 Aug 2022 07:31:21 +0000 Received: from localhost ([127.0.0.1]:42158 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oImN7-00029O-5Z for submit <at> debbugs.gnu.org; Tue, 02 Aug 2022 03:31:21 -0400 Received: from heytings.org ([95.142.160.155]:35040) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <gregory@HIDDEN>) id 1oImN3-00029A-S3 for 56815 <at> debbugs.gnu.org; Tue, 02 Aug 2022 03:31:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1659425476; bh=ZwjY6hWIFLru1qmjjdn2VIN2PiG8cq5UUefJ4aPEDdg=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=xziDLU4H9yYfxY9BFlhU61K7azdaUpksiEEWTIRjl1YVlMLqIwV0b/NL0bGiCDf3D yGWb6CbYvy0LoNFely/7qtjI86p+THVZPcdEjgfuV10JMts0S9KEJVavj7hkt8FIsC IfHVKpw9FSqKFU/W1fHxKY65tBsukdLIcUo/ssWfq/MNqX1B9zuObPfzgs5Fc8fwWI 2OsdmVK9xCaL7I/Fk81AM0+p4R0HyUuRcNpyRnl+iIuy9lu7z10JlX1HRJ6qZtrkpj 5mhSwMDydOnN6YkR0WmzJQ+z4jkcUizR5UNyK/XnGv1ViMAMSPvTGV9+ktTJMEd6Xv D29tjYw7ED3UA== Date: Tue, 02 Aug 2022 07:31:16 +0000 From: Gregory Heytings <gregory@HIDDEN> In-Reply-To: <86y1w7bzum.fsf@HIDDEN> Message-ID: <74ddc877f180e5ccb48f@HIDDEN> References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN> <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN> <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN> <83bkt77nf9.fsf@HIDDEN> <bf6b6a6fd31548b3d6c5@HIDDEN> <83a68r7m2d.fsf@HIDDEN> <bf6b6a6fd3f0eaf40602@HIDDEN> <837d3v7kr9.fsf@HIDDEN> <bf6b6a6fd35ae2bb3303@HIDDEN> <86fsih5bch.fsf@HIDDEN> <83wnbs2nc3.fsf@HIDDEN> <86y1w7bzum.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) >> So if no good ideas arise that are simple enough to implement, I'm okay >> with simply disabling isearch-lazy-highlight in such buffers, as I >> wrote in the original bug report. (Doing that will probably require >> exposing the "long-lines" flag to Lisp, but that's fine by me.) > > Exposing the "long-lines" flag to Lisp is exactly what is needed. > My current plan is to run a hook when long lines are detected, in which modes such as isearch will be free to add any function they like.
X-Loop: help-debbugs@HIDDEN Subject: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Tue, 02 Aug 2022 11:11:02 +0000 Resent-Message-ID: <handler.56815.B56815.16594386488247 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Gregory Heytings <gregory@HIDDEN> Cc: 56815 <at> debbugs.gnu.org, larsi@HIDDEN, juri@HIDDEN Received: via spool by 56815-submit <at> debbugs.gnu.org id=B56815.16594386488247 (code B ref 56815); Tue, 02 Aug 2022 11:11:02 +0000 Received: (at 56815) by debbugs.gnu.org; 2 Aug 2022 11:10:48 +0000 Received: from localhost ([127.0.0.1]:42557 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oIpnU-00028x-3M for submit <at> debbugs.gnu.org; Tue, 02 Aug 2022 07:10:48 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40446) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1oIpnP-00028g-Mb for 56815 <at> debbugs.gnu.org; Tue, 02 Aug 2022 07:10:46 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:42820) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oIpnJ-00022I-U7; Tue, 02 Aug 2022 07:10:37 -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=V2txCNbKue3j+bu/I1WM+w6y8Kp2REliaFH9GivIv2Y=; b=T+XhUleYhgWc IlhtCHT8Pe1PrKhMQScQ2FlRRpVskrAZ9l3EreJxcZyqVhgi69Ti6WoglLllhwWkFwGLrkzR1kVmM Z31lggvuuX9uiBdtiiAbXZjjyUr9qkUFFtwMAMt3fcqap1nKwMSZsfw1gVADeUtgf8ASXGkGVJvZh WEgZKpYI5SWZCubFTaGQLsb0/+YaLXCtQhdOniGH0k3ky7AOfiubN8dhHKg7M4EzSkY9IJ/qs98/v z2xj5Oxy3nwCM4bKpyLlyqLcqffv7C9CkP5GeKG/vxSDXRT+GJ1poU816wxj+CxkRJrLPtCqZoZEw 7tX898qutJ49WvlxtCruGg==; Received: from [87.69.77.57] (port=3554 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oIpnC-0004iv-4T; Tue, 02 Aug 2022 07:10:33 -0400 Date: Tue, 02 Aug 2022 14:10:21 +0300 Message-Id: <83k07q295u.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-Reply-To: <74ddc877f180e5ccb48f@HIDDEN> (message from Gregory Heytings on Tue, 02 Aug 2022 07:31:16 +0000) References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN> <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN> <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN> <83bkt77nf9.fsf@HIDDEN> <bf6b6a6fd31548b3d6c5@HIDDEN> <83a68r7m2d.fsf@HIDDEN> <bf6b6a6fd3f0eaf40602@HIDDEN> <837d3v7kr9.fsf@HIDDEN> <bf6b6a6fd35ae2bb3303@HIDDEN> <86fsih5bch.fsf@HIDDEN> <83wnbs2nc3.fsf@HIDDEN> <86y1w7bzum.fsf@HIDDEN> <74ddc877f180e5ccb48f@HIDDEN> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > Date: Tue, 02 Aug 2022 07:31:16 +0000 > From: Gregory Heytings <gregory@HIDDEN> > cc: Eli Zaretskii <eliz@HIDDEN>, 56815 <at> debbugs.gnu.org, larsi@HIDDEN > > > >> So if no good ideas arise that are simple enough to implement, I'm okay > >> with simply disabling isearch-lazy-highlight in such buffers, as I > >> wrote in the original bug report. (Doing that will probably require > >> exposing the "long-lines" flag to Lisp, but that's fine by me.) > > > > Exposing the "long-lines" flag to Lisp is exactly what is needed. > > > > My current plan is to run a hook when long lines are detected, in which > modes such as isearch will be free to add any function they like. I'm not sure I agree that a hook is a better interface. A hook is only useful to features that are already turned on when the hook is called; features that are turned on later will miss it. By contrast, an accessor function can be called at any time, and for an attribute that, once set remains set, I think it's a more convenient way of adapting features and packages to this condition. Or am I missing something?
X-Loop: help-debbugs@HIDDEN Subject: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect Resent-From: Juri Linkov <juri@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Mon, 08 Aug 2022 17:24:02 +0000 Resent-Message-ID: <handler.56815.B56815.1659979432596 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN> Cc: 56815 <at> debbugs.gnu.org Received: via spool by 56815-submit <at> debbugs.gnu.org id=B56815.1659979432596 (code B ref 56815); Mon, 08 Aug 2022 17:24:02 +0000 Received: (at 56815) by debbugs.gnu.org; 8 Aug 2022 17:23:52 +0000 Received: from localhost ([127.0.0.1]:41855 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oL6Tn-00009X-Vz for submit <at> debbugs.gnu.org; Mon, 08 Aug 2022 13:23:52 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:36195) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1oL6Tg-00008f-Fx for 56815 <at> debbugs.gnu.org; Mon, 08 Aug 2022 13:23:47 -0400 Received: (Authenticated sender: juri@HIDDEN) by mail.gandi.net (Postfix) with ESMTPSA id DF07B100009; Mon, 8 Aug 2022 17:23:37 +0000 (UTC) From: Juri Linkov <juri@HIDDEN> In-Reply-To: <83mtct87ti.fsf@HIDDEN> (Eli Zaretskii's message of "Thu, 28 Jul 2022 20:29:13 +0300") Organization: LINKOV.NET References: <83mtct87ti.fsf@HIDDEN> Date: Mon, 08 Aug 2022 20:20:41 +0300 Message-ID: <86k07i4pp2.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) While waiting when buffer-local current_buffer->long_line_optimizations_p will be exposed to Lisp, I noticed another need for lazy-highlight optimization: in large buffers (but without long lines) some customization makes replacement too slow when lazy-highlight tries to rehighlight the whole buffer after every replacement. For query-replace it should be enough to highlight matches only on the displayed screen, therefore this patch fixes the problem: ``` diff --git a/lisp/replace.el b/lisp/replace.el index cac0edf43a..9a1f6f22e0 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -2744,7 +2750,9 @@ replace-highlight (isearch-case-fold-search case-fold) (isearch-forward (not backward)) (isearch-other-end match-beg) - (isearch-error nil)) + (isearch-error nil) + (isearch-lazy-count nil) + (lazy-highlight-buffer nil)) (isearch-lazy-highlight-new-loop range-beg range-end)))) ```
X-Loop: help-debbugs@HIDDEN Subject: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sun, 14 Aug 2022 13:55:01 +0000 Resent-Message-ID: <handler.56815.B56815.166048525719002 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov <juri@HIDDEN> Cc: 56815 <at> debbugs.gnu.org, gregory@HIDDEN, larsi@HIDDEN Received: via spool by 56815-submit <at> debbugs.gnu.org id=B56815.166048525719002 (code B ref 56815); Sun, 14 Aug 2022 13:55:01 +0000 Received: (at 56815) by debbugs.gnu.org; 14 Aug 2022 13:54:17 +0000 Received: from localhost ([127.0.0.1]:36257 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oNE4G-0004wQ-Lf for submit <at> debbugs.gnu.org; Sun, 14 Aug 2022 09:54:16 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55644) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1oNE4D-0004wA-3E for 56815 <at> debbugs.gnu.org; Sun, 14 Aug 2022 09:54:14 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45526) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oNE47-0007iX-CF; Sun, 14 Aug 2022 09:54:07 -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=wFKmDWpI3jeIAFNadJ65h7pQCWqgUzuecOfzu0Qd9j4=; b=VrJeSF5mjC0c y3sCu2pANQSrt1sJqR9wJUqq6C7xRr3ypm0HRC/miWF80VUH0zKtKQsPWLG6bIdGtxQmh1zUrxA2d v5jSRuRCJveEwCDEU/wrx654Ywf2C48GPnaNjYIbKokuZnHEV7TkMgQFtAVzxnG0wGkO6D0pMacTX +De5TkfOSpUDw4ZumBilEd5CK98BgN0spOaxhdx3FT6vZTqKhyJKtbMhivam+Jk7e4ZUeQzA/NbMv AhyBP1u9kt+OtvVmu77ppntJ6gQ91GF20y2YDouNaN3Ujc67dc6hhkDmTTsT77L7HEVH2eAm05vYF UCa83Qxa1fGJM1BkL6GTJA==; Received: from [87.69.77.57] (port=2978 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oNE46-0004J4-Rp; Sun, 14 Aug 2022 09:54:07 -0400 Date: Sun, 14 Aug 2022 16:53:50 +0300 Message-Id: <83r11jj5ht.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-Reply-To: <86y1w7bzum.fsf@HIDDEN> (message from Juri Linkov on Mon, 01 Aug 2022 21:09:05 +0300) References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN> <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN> <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN> <83bkt77nf9.fsf@HIDDEN> <bf6b6a6fd31548b3d6c5@HIDDEN> <83a68r7m2d.fsf@HIDDEN> <bf6b6a6fd3f0eaf40602@HIDDEN> <837d3v7kr9.fsf@HIDDEN> <bf6b6a6fd35ae2bb3303@HIDDEN> <86fsih5bch.fsf@HIDDEN> <83wnbs2nc3.fsf@HIDDEN> <86y1w7bzum.fsf@HIDDEN> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > From: Juri Linkov <juri@HIDDEN> > Cc: gregory@HIDDEN, larsi@HIDDEN, 56815 <at> debbugs.gnu.org > Date: Mon, 01 Aug 2022 21:09:05 +0300 > > > So if no good ideas arise that are simple enough to implement, I'm > > okay with simply disabling isearch-lazy-highlight in such buffers, as > > I wrote in the original bug report. (Doing that will probably require > > exposing the "long-lines" flag to Lisp, but that's fine by me.) > > Exposing the "long-lines" flag to Lisp is exactly what is needed. > So when lazy-highlight will detect a special value of a new > buffer-local variable when narrowing is in effect due to long lines, > then lazy-highlight can switch to a different algorithm > like you described earlier. Currently isearch-lazy-highlight-new-loop > checks for window-group-start and window-group-end. But when > the "long-lines" flag is set, it should also check for window-hscroll > because narrowed lazy-highlighting should be updated on hscrolling. > > This "long-lines" flag will be also useful for pre-command-hook > and post-command-hook to convey the information about narrowing > to hooks. You can now use the new long-line-optimizations-p predicate for that. Although from your description above, perhaps Isearch should behave like that in a buffer with line-truncation regardless of the long lines.
X-Loop: help-debbugs@HIDDEN Subject: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect Resent-From: Juri Linkov <juri@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sun, 21 Aug 2022 16:51:02 +0000 Resent-Message-ID: <handler.56815.B56815.166110062024438 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN> Cc: 56815 <at> debbugs.gnu.org, gregory@HIDDEN, larsi@HIDDEN Received: via spool by 56815-submit <at> debbugs.gnu.org id=B56815.166110062024438 (code B ref 56815); Sun, 21 Aug 2022 16:51:02 +0000 Received: (at 56815) by debbugs.gnu.org; 21 Aug 2022 16:50:20 +0000 Received: from localhost ([127.0.0.1]:36654 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oPo9U-0006M3-3V for submit <at> debbugs.gnu.org; Sun, 21 Aug 2022 12:50:20 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:54405) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1oPo9J-0006LJ-J7 for 56815 <at> debbugs.gnu.org; Sun, 21 Aug 2022 12:50:10 -0400 Received: (Authenticated sender: juri@HIDDEN) by mail.gandi.net (Postfix) with ESMTPSA id 2A838C0003; Sun, 21 Aug 2022 16:50:01 +0000 (UTC) From: Juri Linkov <juri@HIDDEN> In-Reply-To: <83r11jj5ht.fsf@HIDDEN> (Eli Zaretskii's message of "Sun, 14 Aug 2022 16:53:50 +0300") Organization: LINKOV.NET References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN> <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN> <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN> <83bkt77nf9.fsf@HIDDEN> <bf6b6a6fd31548b3d6c5@HIDDEN> <83a68r7m2d.fsf@HIDDEN> <bf6b6a6fd3f0eaf40602@HIDDEN> <837d3v7kr9.fsf@HIDDEN> <bf6b6a6fd35ae2bb3303@HIDDEN> <86fsih5bch.fsf@HIDDEN> <83wnbs2nc3.fsf@HIDDEN> <86y1w7bzum.fsf@HIDDEN> <83r11jj5ht.fsf@HIDDEN> Date: Sun, 21 Aug 2022 19:32:14 +0300 Message-ID: <86v8qlljwp.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) > You can now use the new long-line-optimizations-p predicate for that. > Although from your description above, perhaps Isearch should behave > like that in a buffer with line-truncation regardless of the long > lines. This means using the same condition like in 'line-move'? (and (or truncate-lines (and (integerp truncate-partial-width-windows) (< (window-total-width) truncate-partial-width-windows)) (and truncate-partial-width-windows (not (integerp truncate-partial-width-windows)) (not (window-full-width-p)))) ;; ...or if lines are truncated, this buffer ;; doesn't have very long lines. (long-line-optimizations-p)) I suggest to leave 'long-line-optimizations-p' at the end because in such cases when 'lazy-highlight-cleanup' is customized to nil the users might want to leave highlighting on truncated lines after exiting Isearch to see matches when scrolling horizontally (when lines are not long).
X-Loop: help-debbugs@HIDDEN Subject: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sun, 21 Aug 2022 17:07:01 +0000 Resent-Message-ID: <handler.56815.B56815.166110158225977 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov <juri@HIDDEN> Cc: 56815 <at> debbugs.gnu.org, gregory@HIDDEN, larsi@HIDDEN Received: via spool by 56815-submit <at> debbugs.gnu.org id=B56815.166110158225977 (code B ref 56815); Sun, 21 Aug 2022 17:07:01 +0000 Received: (at 56815) by debbugs.gnu.org; 21 Aug 2022 17:06:22 +0000 Received: from localhost ([127.0.0.1]:36663 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oPoP0-0006kt-6u for submit <at> debbugs.gnu.org; Sun, 21 Aug 2022 13:06:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60432) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1oPoOv-0006kd-E9 for 56815 <at> debbugs.gnu.org; Sun, 21 Aug 2022 13:06:20 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47490) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oPoOp-0007Ur-LM; Sun, 21 Aug 2022 13:06:11 -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=FXS+lfntWdpz24y+Rg+m/3z3By7vuKkLa31XHRzPLm4=; b=UHzxceXDSZKQ Ztr4no/Q9wKJrdM4qHgqBIbSnOrXBSUx2f9tefDgJrUAHyIxNwg2yqN5cEDFyAdVGgKqQjCV+5W6m WXNAlJNJyXSAuLDIOS15CcmIdQuqvwln6qis6NG1T+ZIb4TRaA7RdsepwpAevmJNwGaeB8NO7rnOo 5Hg8qL64E1Xvq2QaTkkkA/nKo3slhYz0HOFsuZJEz3D/aDnU2ZUKQ8/6Qsv1yF+XTK+4iSX1czktU zfpxfxqoaJR4aMUZYFus4q24Q0/K9ScCYrbPbpfRDGiIvKnoAlKB5UaHI1XZNUMfOgNRDdw62fa3y LdQUkBaMSkYvyyWbotMePA==; Received: from [87.69.77.57] (port=2815 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oPoOp-0004Ry-04; Sun, 21 Aug 2022 13:06:11 -0400 Date: Sun, 21 Aug 2022 20:06:12 +0300 Message-Id: <83k071bk6z.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-Reply-To: <86v8qlljwp.fsf@HIDDEN> (message from Juri Linkov on Sun, 21 Aug 2022 19:32:14 +0300) References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN> <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN> <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN> <83bkt77nf9.fsf@HIDDEN> <bf6b6a6fd31548b3d6c5@HIDDEN> <83a68r7m2d.fsf@HIDDEN> <bf6b6a6fd3f0eaf40602@HIDDEN> <837d3v7kr9.fsf@HIDDEN> <bf6b6a6fd35ae2bb3303@HIDDEN> <86fsih5bch.fsf@HIDDEN> <83wnbs2nc3.fsf@HIDDEN> <86y1w7bzum.fsf@HIDDEN> <83r11jj5ht.fsf@HIDDEN> <86v8qlljwp.fsf@HIDDEN> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > From: Juri Linkov <juri@HIDDEN> > Cc: gregory@HIDDEN, larsi@HIDDEN, 56815 <at> debbugs.gnu.org > Date: Sun, 21 Aug 2022 19:32:14 +0300 > > > You can now use the new long-line-optimizations-p predicate for that. > > Although from your description above, perhaps Isearch should behave > > like that in a buffer with line-truncation regardless of the long > > lines. > > This means using the same condition like in 'line-move'? > > (and > (or truncate-lines > (and (integerp truncate-partial-width-windows) > (< (window-total-width) > truncate-partial-width-windows)) > (and truncate-partial-width-windows > (not (integerp truncate-partial-width-windows)) > (not (window-full-width-p)))) > ;; ...or if lines are truncated, this buffer > ;; doesn't have very long lines. > (long-line-optimizations-p)) Yes, this is the (unfortunately complicated) way of determining whether the window has truncated lines. > I suggest to leave 'long-line-optimizations-p' at the end because It _is_ at the end, isn't it? > in such cases when 'lazy-highlight-cleanup' is customized to nil > the users might want to leave highlighting on truncated lines > after exiting Isearch to see matches when scrolling horizontally > (when lines are not long). Ideally, when the window is hscrolled, the matches that come into view should be lazily highlighted, and those which become invisible should be de-highlighted.
X-Loop: help-debbugs@HIDDEN Subject: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect Resent-From: Juri Linkov <juri@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sun, 21 Aug 2022 19:09:02 +0000 Resent-Message-ID: <handler.56815.B56815.166110889030531 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN> Cc: 56815 <at> debbugs.gnu.org, gregory@HIDDEN, larsi@HIDDEN Received: via spool by 56815-submit <at> debbugs.gnu.org id=B56815.166110889030531 (code B ref 56815); Sun, 21 Aug 2022 19:09:02 +0000 Received: (at 56815) by debbugs.gnu.org; 21 Aug 2022 19:08:10 +0000 Received: from localhost ([127.0.0.1]:36813 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oPqIs-0007wN-Ab for submit <at> debbugs.gnu.org; Sun, 21 Aug 2022 15:08:10 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:39177) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1oPqIp-0007vw-99 for 56815 <at> debbugs.gnu.org; Sun, 21 Aug 2022 15:08:07 -0400 Received: (Authenticated sender: juri@HIDDEN) by mail.gandi.net (Postfix) with ESMTPSA id C2AAEFF803; Sun, 21 Aug 2022 19:07:57 +0000 (UTC) From: Juri Linkov <juri@HIDDEN> In-Reply-To: <83k071bk6z.fsf@HIDDEN> (Eli Zaretskii's message of "Sun, 21 Aug 2022 20:06:12 +0300") Organization: LINKOV.NET References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN> <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN> <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN> <83bkt77nf9.fsf@HIDDEN> <bf6b6a6fd31548b3d6c5@HIDDEN> <83a68r7m2d.fsf@HIDDEN> <bf6b6a6fd3f0eaf40602@HIDDEN> <837d3v7kr9.fsf@HIDDEN> <bf6b6a6fd35ae2bb3303@HIDDEN> <86fsih5bch.fsf@HIDDEN> <83wnbs2nc3.fsf@HIDDEN> <86y1w7bzum.fsf@HIDDEN> <83r11jj5ht.fsf@HIDDEN> <86v8qlljwp.fsf@HIDDEN> <83k071bk6z.fsf@HIDDEN> Date: Sun, 21 Aug 2022 22:03:48 +0300 Message-ID: <86edx9fmgb.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) >> This means using the same condition like in 'line-move'? >> >> (and >> (or truncate-lines >> (and (integerp truncate-partial-width-windows) >> (< (window-total-width) >> truncate-partial-width-windows)) >> (and truncate-partial-width-windows >> (not (integerp truncate-partial-width-windows)) >> (not (window-full-width-p)))) >> ;; ...or if lines are truncated, this buffer >> ;; doesn't have very long lines. >> (long-line-optimizations-p)) > > Yes, this is the (unfortunately complicated) way of determining > whether the window has truncated lines. Would it be possible to refactor this to a separate function? I guess it could be in simple.el. But what would be a good name? Maybe 'truncate-lines-p'?
X-Loop: help-debbugs@HIDDEN Subject: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sun, 21 Aug 2022 19:36:01 +0000 Resent-Message-ID: <handler.56815.B56815.1661110535623 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov <juri@HIDDEN> Cc: 56815 <at> debbugs.gnu.org, gregory@HIDDEN, larsi@HIDDEN Received: via spool by 56815-submit <at> debbugs.gnu.org id=B56815.1661110535623 (code B ref 56815); Sun, 21 Aug 2022 19:36:01 +0000 Received: (at 56815) by debbugs.gnu.org; 21 Aug 2022 19:35:35 +0000 Received: from localhost ([127.0.0.1]:36831 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oPqjO-00009z-QD for submit <at> debbugs.gnu.org; Sun, 21 Aug 2022 15:35:35 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52728) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1oPqjL-00009j-Dj for 56815 <at> debbugs.gnu.org; Sun, 21 Aug 2022 15:35:34 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:43054) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oPqjF-0003UN-3g; Sun, 21 Aug 2022 15:35:25 -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=Lf5JnRZf0OsDEOOaeEl0xEt8JnrqdUhpgEK1kaPlVC8=; b=F1labF9m6b1i ujIhGLssiWnn0lbg/+BIOLmkvuC3QDcaEZvxsAuahwOly/pHN7nnxiSFtg0432WsRWwNt92vYIyPX Qpf7Yg2oMFiqDm0J2nuNljqIAe4GSb9SeZr4M8DBUkD/x3r75usW/A0GJr/ulSCF7G/xBEi7h9G8g XhXTomJdkEEl36oY+hRSBfMoV0eqC4TsdG+6b49Bk805KmP8UjFrHQo0Ed176A6+xbC7BPodMU5Ke V6D7dHRBcMpPBb4sKklmDz+wr8JW5r8A0RjmcOzxWjlOS5b9P+7gC0q15pojsb07mGiX/ZAx8IO/D S5n18VJgRCFWavhwVOL0/A==; Received: from [87.69.77.57] (port=4004 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oPqjD-0003kp-51; Sun, 21 Aug 2022 15:35:24 -0400 Date: Sun, 21 Aug 2022 22:35:24 +0300 Message-Id: <83fshpbdab.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-Reply-To: <86edx9fmgb.fsf@HIDDEN> (message from Juri Linkov on Sun, 21 Aug 2022 22:03:48 +0300) References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN> <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN> <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN> <83bkt77nf9.fsf@HIDDEN> <bf6b6a6fd31548b3d6c5@HIDDEN> <83a68r7m2d.fsf@HIDDEN> <bf6b6a6fd3f0eaf40602@HIDDEN> <837d3v7kr9.fsf@HIDDEN> <bf6b6a6fd35ae2bb3303@HIDDEN> <86fsih5bch.fsf@HIDDEN> <83wnbs2nc3.fsf@HIDDEN> <86y1w7bzum.fsf@HIDDEN> <83r11jj5ht.fsf@HIDDEN> <86v8qlljwp.fsf@HIDDEN> <83k071bk6z.fsf@HIDDEN> <86edx9fmgb.fsf@HIDDEN> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > From: Juri Linkov <juri@HIDDEN> > Cc: gregory@HIDDEN, larsi@HIDDEN, 56815 <at> debbugs.gnu.org > Date: Sun, 21 Aug 2022 22:03:48 +0300 > > >> This means using the same condition like in 'line-move'? > >> > >> (and > >> (or truncate-lines > >> (and (integerp truncate-partial-width-windows) > >> (< (window-total-width) > >> truncate-partial-width-windows)) > >> (and truncate-partial-width-windows > >> (not (integerp truncate-partial-width-windows)) > >> (not (window-full-width-p)))) > >> ;; ...or if lines are truncated, this buffer > >> ;; doesn't have very long lines. > >> (long-line-optimizations-p)) > > > > Yes, this is the (unfortunately complicated) way of determining > > whether the window has truncated lines. > > Would it be possible to refactor this to a separate function? Sure. > I guess it could be in simple.el. But what would be a good name? > Maybe 'truncate-lines-p'? lines-truncated-p, I guess. Or window-lines-truncated-p. And I think it should be in window.el.
X-Loop: help-debbugs@HIDDEN Subject: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect Resent-From: Juri Linkov <juri@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Mon, 22 Aug 2022 06:55:02 +0000 Resent-Message-ID: <handler.56815.B56815.166115129929411 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN> Cc: 56815 <at> debbugs.gnu.org, gregory@HIDDEN, larsi@HIDDEN Received: via spool by 56815-submit <at> debbugs.gnu.org id=B56815.166115129929411 (code B ref 56815); Mon, 22 Aug 2022 06:55:02 +0000 Received: (at 56815) by debbugs.gnu.org; 22 Aug 2022 06:54:59 +0000 Received: from localhost ([127.0.0.1]:37648 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oQ1Kt-0007eI-2L for submit <at> debbugs.gnu.org; Mon, 22 Aug 2022 02:54:59 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:54363) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1oQ1Kp-0007e0-If for 56815 <at> debbugs.gnu.org; Mon, 22 Aug 2022 02:54:58 -0400 Received: (Authenticated sender: juri@HIDDEN) by mail.gandi.net (Postfix) with ESMTPSA id 61CB210000E; Mon, 22 Aug 2022 06:54:44 +0000 (UTC) From: Juri Linkov <juri@HIDDEN> In-Reply-To: <83fshpbdab.fsf@HIDDEN> (Eli Zaretskii's message of "Sun, 21 Aug 2022 22:35:24 +0300") Organization: LINKOV.NET References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN> <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN> <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN> <83bkt77nf9.fsf@HIDDEN> <bf6b6a6fd31548b3d6c5@HIDDEN> <83a68r7m2d.fsf@HIDDEN> <bf6b6a6fd3f0eaf40602@HIDDEN> <837d3v7kr9.fsf@HIDDEN> <bf6b6a6fd35ae2bb3303@HIDDEN> <86fsih5bch.fsf@HIDDEN> <83wnbs2nc3.fsf@HIDDEN> <86y1w7bzum.fsf@HIDDEN> <83r11jj5ht.fsf@HIDDEN> <86v8qlljwp.fsf@HIDDEN> <83k071bk6z.fsf@HIDDEN> <86edx9fmgb.fsf@HIDDEN> <83fshpbdab.fsf@HIDDEN> Date: Mon, 22 Aug 2022 09:48:47 +0300 Message-ID: <86sfloixio.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain >> I guess it could be in simple.el. But what would be a good name? >> Maybe 'truncate-lines-p'? > > lines-truncated-p, I guess. Or window-lines-truncated-p. And I think > it should be in window.el. To keep the prefix like in all truncate-related names, truncated-partial-width-window-p could serve as an example: (truncated-partial-width-window-p &optional WINDOW) (truncated-lines-p &optional window) Or can truncated-partial-width-window-p be called directly? By just (or truncate-lines (truncated-partial-width-window-p)) Anyway, here is the patch that probably not needed when truncated-partial-width-window-p can be used instead: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=truncated-lines-p.patch diff --git a/lisp/simple.el b/lisp/simple.el index d862c0e9a8..8f7440a3bb 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -7700,13 +7700,7 @@ line-move ;; Lines are not truncated... (not (and - (or truncate-lines - (and (integerp truncate-partial-width-windows) - (< (window-total-width) - truncate-partial-width-windows)) - (and truncate-partial-width-windows - (not (integerp truncate-partial-width-windows)) - (not (window-full-width-p)))) + (truncated-lines-p) ;; ...or if lines are truncated, this buffer ;; doesn't have very long lines. (long-line-optimizations-p))) @@ -7716,14 +7710,7 @@ line-move ;; Display-based column are incompatible with goal-column. (not goal-column) ;; Lines aren't truncated. - (not - (or truncate-lines - (and (integerp truncate-partial-width-windows) - (< (window-width) - truncate-partial-width-windows)) - (and truncate-partial-width-windows - (not (integerp truncate-partial-width-windows)) - (not (window-full-width-p))))) + (not (truncated-lines-p)) ;; When the text in the window is scrolled to the left, ;; display-based motion doesn't make sense (because each ;; logical line occupies exactly one screen line). diff --git a/lisp/window.el b/lisp/window.el index 4d88ffa903..aecac8c8d0 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -9012,6 +9023,18 @@ shrink-window-horizontally (interactive "p") (shrink-window delta t)) +(defun truncated-lines-p (&optional window) + "Return non-nil when lines are truncated. +This depends on the values of `truncate-lines' and +`truncate-partial-width-windows'." + (or truncate-lines + (and (integerp truncate-partial-width-windows) + (< (window-total-width window) + truncate-partial-width-windows)) + (and truncate-partial-width-windows + (not (integerp truncate-partial-width-windows)) + (not (window-full-width-p window))))) + (defun count-screen-lines (&optional beg end count-final-newline window) "Return the number of screen lines in the region. The number of screen lines may be different from the number of actual lines, @@ -9044,10 +9067,7 @@ count-screen-lines ;; vertical-motion returns a number that is 1 larger than it ;; should. We need to fix that. (setq end-invisible-p - (and (or truncate-lines - (and (natnump truncate-partial-width-windows) - (< (window-total-width window) - truncate-partial-width-windows))) + (and (truncated-lines-p window) (save-excursion (goto-char finish) (> (- (current-column) (window-hscroll window)) --=-=-=--
X-Loop: help-debbugs@HIDDEN Subject: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Mon, 22 Aug 2022 11:33:01 +0000 Resent-Message-ID: <handler.56815.B56815.166116792618883 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov <juri@HIDDEN> Cc: 56815 <at> debbugs.gnu.org, gregory@HIDDEN, larsi@HIDDEN Received: via spool by 56815-submit <at> debbugs.gnu.org id=B56815.166116792618883 (code B ref 56815); Mon, 22 Aug 2022 11:33:01 +0000 Received: (at 56815) by debbugs.gnu.org; 22 Aug 2022 11:32:06 +0000 Received: from localhost ([127.0.0.1]:38156 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oQ5f4-0004uU-DG for submit <at> debbugs.gnu.org; Mon, 22 Aug 2022 07:32:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40738) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1oQ5f2-0004tx-P9 for 56815 <at> debbugs.gnu.org; Mon, 22 Aug 2022 07:32:05 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45008) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oQ5ev-0007BX-NV; Mon, 22 Aug 2022 07:31:59 -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=nPXhuAbpK1KUnDM9nt35FzsIGK+CB0tlzqv/da/VuW0=; b=fAUI9DTpSgt+ yKx6MzaD39v4Lwr8gINEllak6LcJkKXmMRol+cb/VXGqy7gDPFvMt57t4sEPRHFTs3pFyTfkD1qdG pOeo0ZFNVGRDSgOEejCP26HeOtj1ni/klKhxUVTLxbl/C8PWMsXOp0T4uvLrlBdXSlrHWkasG/qZl Q1tXkS2teZKy/GU1PEhbYkVq4gUrweKT/P/a1ryU/OIFrDqIk13DhMNi+ZhkDczjJNdmdURCqrdXF GblMxgJ/tAUL2YiybVL14LPHABcpokCDSiNBpgjoexPzFwlj+BBqXFzE+PLYm9zQz9d4+IYatzQW6 KLm7EDqgTNrqb0bMfyh7KQ==; Received: from [87.69.77.57] (port=2681 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oQ5eu-0006lV-RP; Mon, 22 Aug 2022 07:31:57 -0400 Date: Mon, 22 Aug 2022 14:32:01 +0300 Message-Id: <838rngbjke.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-Reply-To: <86sfloixio.fsf@HIDDEN> (message from Juri Linkov on Mon, 22 Aug 2022 09:48:47 +0300) References: <83mtct87ti.fsf@HIDDEN> <865yjhc85k.fsf@HIDDEN> <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN> <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN> <83bkt77nf9.fsf@HIDDEN> <bf6b6a6fd31548b3d6c5@HIDDEN> <83a68r7m2d.fsf@HIDDEN> <bf6b6a6fd3f0eaf40602@HIDDEN> <837d3v7kr9.fsf@HIDDEN> <bf6b6a6fd35ae2bb3303@HIDDEN> <86fsih5bch.fsf@HIDDEN> <83wnbs2nc3.fsf@HIDDEN> <86y1w7bzum.fsf@HIDDEN> <83r11jj5ht.fsf@HIDDEN> <86v8qlljwp.fsf@HIDDEN> <83k071bk6z.fsf@HIDDEN> <86edx9fmgb.fsf@HIDDEN> <83fshpbdab.fsf@HIDDEN> <86sfloixio.fsf@HIDDEN> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > From: Juri Linkov <juri@HIDDEN> > Cc: gregory@HIDDEN, larsi@HIDDEN, 56815 <at> debbugs.gnu.org > Date: Mon, 22 Aug 2022 09:48:47 +0300 > > >> I guess it could be in simple.el. But what would be a good name? > >> Maybe 'truncate-lines-p'? > > > > lines-truncated-p, I guess. Or window-lines-truncated-p. And I think > > it should be in window.el. > > To keep the prefix like in all truncate-related names, > truncated-partial-width-window-p could serve as an example: It has "window" in its name. Your proposal doesn't, so the name is too general, IMO. > Or can truncated-partial-width-window-p be called directly? By just > > (or truncate-lines (truncated-partial-width-window-p)) Fine by me.
X-Loop: help-debbugs@HIDDEN Subject: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect Resent-From: Juri Linkov <juri@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Tue, 23 Aug 2022 08:10:01 +0000 Resent-Message-ID: <handler.56815.B56815.16612421441764 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN> Cc: 56815 <at> debbugs.gnu.org, gregory@HIDDEN, larsi@HIDDEN Received: via spool by 56815-submit <at> debbugs.gnu.org id=B56815.16612421441764 (code B ref 56815); Tue, 23 Aug 2022 08:10:01 +0000 Received: (at 56815) by debbugs.gnu.org; 23 Aug 2022 08:09:04 +0000 Received: from localhost ([127.0.0.1]:42498 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oQOy7-0000SO-Oz for submit <at> debbugs.gnu.org; Tue, 23 Aug 2022 04:09:04 -0400 Received: from relay12.mail.gandi.net ([217.70.178.232]:36063) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1oQOy6-0000Rf-4f for 56815 <at> debbugs.gnu.org; Tue, 23 Aug 2022 04:09:02 -0400 Received: (Authenticated sender: juri@HIDDEN) by mail.gandi.net (Postfix) with ESMTPSA id 55BEE200007; Tue, 23 Aug 2022 08:08:55 +0000 (UTC) From: Juri Linkov <juri@HIDDEN> In-Reply-To: <838rngbjke.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 22 Aug 2022 14:32:01 +0300") Organization: LINKOV.NET References: <83mtct87ti.fsf@HIDDEN> <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN> <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN> <83bkt77nf9.fsf@HIDDEN> <bf6b6a6fd31548b3d6c5@HIDDEN> <83a68r7m2d.fsf@HIDDEN> <bf6b6a6fd3f0eaf40602@HIDDEN> <837d3v7kr9.fsf@HIDDEN> <bf6b6a6fd35ae2bb3303@HIDDEN> <86fsih5bch.fsf@HIDDEN> <83wnbs2nc3.fsf@HIDDEN> <86y1w7bzum.fsf@HIDDEN> <83r11jj5ht.fsf@HIDDEN> <86v8qlljwp.fsf@HIDDEN> <83k071bk6z.fsf@HIDDEN> <86edx9fmgb.fsf@HIDDEN> <83fshpbdab.fsf@HIDDEN> <86sfloixio.fsf@HIDDEN> <838rngbjke.fsf@HIDDEN> Date: Tue, 23 Aug 2022 10:41:21 +0300 Message-ID: <86zgfvie26.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain >> Or can truncated-partial-width-window-p be called directly? By just >> >> (or truncate-lines (truncated-partial-width-window-p)) > > Fine by me. Then I'll push a better patch: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=truncated-partial-width-window-p.patch diff --git a/lisp/simple.el b/lisp/simple.el index 460aff8bd8..72674d3a1d 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -7700,13 +7700,7 @@ line-move ;; Lines are not truncated... (not (and - (or truncate-lines - (and (integerp truncate-partial-width-windows) - (< (window-total-width) - truncate-partial-width-windows)) - (and truncate-partial-width-windows - (not (integerp truncate-partial-width-windows)) - (not (window-full-width-p)))) + (or truncate-lines (truncated-partial-width-window-p)) ;; ...or if lines are truncated, this buffer ;; doesn't have very long lines. (long-line-optimizations-p))) @@ -7716,14 +7710,7 @@ line-move ;; Display-based column are incompatible with goal-column. (not goal-column) ;; Lines aren't truncated. - (not - (or truncate-lines - (and (integerp truncate-partial-width-windows) - (< (window-width) - truncate-partial-width-windows)) - (and truncate-partial-width-windows - (not (integerp truncate-partial-width-windows)) - (not (window-full-width-p))))) + (not (or truncate-lines (truncated-partial-width-window-p))) ;; When the text in the window is scrolled to the left, ;; display-based motion doesn't make sense (because each ;; logical line occupies exactly one screen line). diff --git a/lisp/window.el b/lisp/window.el index 4d88ffa903..98c14e7bbc 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -9044,10 +9055,7 @@ count-screen-lines ;; vertical-motion returns a number that is 1 larger than it ;; should. We need to fix that. (setq end-invisible-p - (and (or truncate-lines - (and (natnump truncate-partial-width-windows) - (< (window-total-width window) - truncate-partial-width-windows))) + (and (or truncate-lines (truncated-partial-width-window-p window)) (save-excursion (goto-char finish) (> (- (current-column) (window-hscroll window)) --=-=-=--
X-Loop: help-debbugs@HIDDEN Subject: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Tue, 23 Aug 2022 12:12:01 +0000 Resent-Message-ID: <handler.56815.B56815.16612567073064 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov <juri@HIDDEN> Cc: 56815 <at> debbugs.gnu.org, gregory@HIDDEN, larsi@HIDDEN Received: via spool by 56815-submit <at> debbugs.gnu.org id=B56815.16612567073064 (code B ref 56815); Tue, 23 Aug 2022 12:12:01 +0000 Received: (at 56815) by debbugs.gnu.org; 23 Aug 2022 12:11:47 +0000 Received: from localhost ([127.0.0.1]:42851 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oQSl0-0000nL-Jy for submit <at> debbugs.gnu.org; Tue, 23 Aug 2022 08:11:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58416) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1oQSky-0000n8-2W for 56815 <at> debbugs.gnu.org; Tue, 23 Aug 2022 08:11:44 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34154) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oQSkr-0000EG-Nv; Tue, 23 Aug 2022 08:11:37 -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=mYtYgC75ILKnHH5B1SxQq21O2Eypvm5Pz/G8eMXfzHk=; b=ITfFfTrX2B1l ww+PSSoWFwhayBIW2UbLFG2Gdj/jD/N+RynxYTPVUCKUHOQ6OPaadf5NqLdobvktXxtBkBrfKGynN ieRqrVcOkjGLUjRq+bKSeZ9KV+tyPCPQiFRWaFg4HTxDhSg59qbDhWtY2J9zbuBoikKMjWMBtX5WM hvuH22F8HlVfu2s7anz0Z9L1LmOA0VVSUH+HZwnrsYsvDqcdWzaiio+YTj14hSrU6DtQ6EJHGE6DS FNwECE0Y6xK4ML9/uP2SncJLghUBXFrW49obvC98OIjos7z+1asrZY3a9skIiqeUYwSsYqDpj1yKh oJb6t2ih8NNHqoWCnQcHPg==; Received: from [87.69.77.57] (port=2481 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1oQSkr-0002hT-7w; Tue, 23 Aug 2022 08:11:37 -0400 Date: Tue, 23 Aug 2022 15:11:42 +0300 Message-Id: <83o7wb88ht.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-Reply-To: <86zgfvie26.fsf@HIDDEN> (message from Juri Linkov on Tue, 23 Aug 2022 10:41:21 +0300) References: <83mtct87ti.fsf@HIDDEN> <83fsik8o39.fsf@HIDDEN> <87r124kul6.fsf@HIDDEN> <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN> <83bkt77nf9.fsf@HIDDEN> <bf6b6a6fd31548b3d6c5@HIDDEN> <83a68r7m2d.fsf@HIDDEN> <bf6b6a6fd3f0eaf40602@HIDDEN> <837d3v7kr9.fsf@HIDDEN> <bf6b6a6fd35ae2bb3303@HIDDEN> <86fsih5bch.fsf@HIDDEN> <83wnbs2nc3.fsf@HIDDEN> <86y1w7bzum.fsf@HIDDEN> <83r11jj5ht.fsf@HIDDEN> <86v8qlljwp.fsf@HIDDEN> <83k071bk6z.fsf@HIDDEN> <86edx9fmgb.fsf@HIDDEN> <83fshpbdab.fsf@HIDDEN> <86sfloixio.fsf@HIDDEN> <838rngbjke.fsf@HIDDEN> <86zgfvie26.fsf@HIDDEN> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > From: Juri Linkov <juri@HIDDEN> > Cc: gregory@HIDDEN, larsi@HIDDEN, 56815 <at> debbugs.gnu.org > Date: Tue, 23 Aug 2022 10:41:21 +0300 > > >> (or truncate-lines (truncated-partial-width-window-p)) > > > > Fine by me. > > Then I'll push a better patch: Btw, I didn't use window-total-width instead of window-width. What I did mimics what the display engine does when it determines whether to truncate lines in a window. So I think truncated-partial-width-window-p should be fixed to use window-total-width instead.
X-Loop: help-debbugs@HIDDEN Subject: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect Resent-From: Juri Linkov <juri@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Tue, 23 Aug 2022 16:51:02 +0000 Resent-Message-ID: <handler.56815.B56815.1661273448468 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN> Cc: 56815 <at> debbugs.gnu.org, gregory@HIDDEN, larsi@HIDDEN Received: via spool by 56815-submit <at> debbugs.gnu.org id=B56815.1661273448468 (code B ref 56815); Tue, 23 Aug 2022 16:51:02 +0000 Received: (at 56815) by debbugs.gnu.org; 23 Aug 2022 16:50:48 +0000 Received: from localhost ([127.0.0.1]:44918 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oQX71-00007U-Jb for submit <at> debbugs.gnu.org; Tue, 23 Aug 2022 12:50:47 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:37889) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1oQX6z-00007H-Ph for 56815 <at> debbugs.gnu.org; Tue, 23 Aug 2022 12:50:46 -0400 Received: (Authenticated sender: juri@HIDDEN) by mail.gandi.net (Postfix) with ESMTPSA id 08E7B240002; Tue, 23 Aug 2022 16:50:37 +0000 (UTC) From: Juri Linkov <juri@HIDDEN> In-Reply-To: <83o7wb88ht.fsf@HIDDEN> (Eli Zaretskii's message of "Tue, 23 Aug 2022 15:11:42 +0300") Organization: LINKOV.NET References: <83mtct87ti.fsf@HIDDEN> <86mtcrpyzs.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN> <83bkt77nf9.fsf@HIDDEN> <bf6b6a6fd31548b3d6c5@HIDDEN> <83a68r7m2d.fsf@HIDDEN> <bf6b6a6fd3f0eaf40602@HIDDEN> <837d3v7kr9.fsf@HIDDEN> <bf6b6a6fd35ae2bb3303@HIDDEN> <86fsih5bch.fsf@HIDDEN> <83wnbs2nc3.fsf@HIDDEN> <86y1w7bzum.fsf@HIDDEN> <83r11jj5ht.fsf@HIDDEN> <86v8qlljwp.fsf@HIDDEN> <83k071bk6z.fsf@HIDDEN> <86edx9fmgb.fsf@HIDDEN> <83fshpbdab.fsf@HIDDEN> <86sfloixio.fsf@HIDDEN> <838rngbjke.fsf@HIDDEN> <86zgfvie26.fsf@HIDDEN> <83o7wb88ht.fsf@HIDDEN> Date: Tue, 23 Aug 2022 19:49:40 +0300 Message-ID: <86bksaoqfv.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain >> >> (or truncate-lines (truncated-partial-width-window-p)) >> > >> > Fine by me. >> >> Then I'll push a better patch: > > Btw, I didn't use window-total-width instead of window-width. What I > did mimics what the display engine does when it determines whether to > truncate lines in a window. So I think > truncated-partial-width-window-p should be fixed to use > window-total-width instead. Now this patch fixes truncated-partial-width-window-p to use window-total-width. Also it fixes the recent code for long_line_optimizations_p in scan_for_column to better mimic what the display engine does: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=truncated-partial-width-window-p.patch diff --git a/lisp/simple.el b/lisp/simple.el index 460aff8bd8..6e8cd798e0 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -7700,13 +7700,7 @@ line-move ;; Lines are not truncated... (not (and - (or truncate-lines - (and (integerp truncate-partial-width-windows) - (< (window-total-width) - truncate-partial-width-windows)) - (and truncate-partial-width-windows - (not (integerp truncate-partial-width-windows)) - (not (window-full-width-p)))) + (or truncate-lines (truncated-partial-width-window-p)) ;; ...or if lines are truncated, this buffer ;; doesn't have very long lines. (long-line-optimizations-p))) @@ -7716,14 +7710,7 @@ line-move ;; Display-based column are incompatible with goal-column. (not goal-column) ;; Lines aren't truncated. - (not - (or truncate-lines - (and (integerp truncate-partial-width-windows) - (< (window-width) - truncate-partial-width-windows)) - (and truncate-partial-width-windows - (not (integerp truncate-partial-width-windows)) - (not (window-full-width-p))))) + (not (or truncate-lines (truncated-partial-width-window-p))) ;; When the text in the window is scrolled to the left, ;; display-based motion doesn't make sense (because each ;; logical line occupies exactly one screen line). @@ -7983,7 +7970,7 @@ line-move-finish ;; Move to the desired column. (if (and line-move-visual - (not (or truncate-lines truncate-partial-width-windows))) + (not (or truncate-lines (truncated-partial-width-window-p)))) ;; Under line-move-visual, goal-column should be ;; interpreted in units of the frame's canonical character ;; width, which is exactly what vertical-motion does. diff --git a/lisp/window.el b/lisp/window.el index 4d88ffa903..a2559a2591 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -9044,10 +9055,7 @@ count-screen-lines ;; vertical-motion returns a number that is 1 larger than it ;; should. We need to fix that. (setq end-invisible-p - (and (or truncate-lines - (and (natnump truncate-partial-width-windows) - (< (window-total-width window) - truncate-partial-width-windows))) + (and (or truncate-lines (truncated-partial-width-window-p window)) (save-excursion (goto-char finish) (> (- (current-column) (window-hscroll window)) @@ -10140,7 +10148,7 @@ scroll-command--goto-goal-column (when goal-column ;; Move to the desired column. (if (and line-move-visual - (not (or truncate-lines truncate-partial-width-windows))) + (not (or truncate-lines (truncated-partial-width-window-p)))) ;; Under line-move-visual, goal-column should be ;; interpreted in units of the frame's canonical character ;; width, which is exactly what vertical-motion does. @@ -10449,7 +10457,7 @@ truncated-partial-width-window-p (let ((t-p-w-w (buffer-local-value 'truncate-partial-width-windows (window-buffer window)))) (if (integerp t-p-w-w) - (< (window-width window) t-p-w-w) + (< (window-total-width window) t-p-w-w) t-p-w-w)))) diff --git a/src/indent.c b/src/indent.c index cb368024d9..aa905f387b 100644 --- a/src/indent.c +++ b/src/indent.c @@ -577,12 +577,15 @@ scan_for_column (ptrdiff_t *endpos, EMACS_INT *goalcol, if (!NILP (BVAR (current_buffer, truncate_lines))) lines_truncated = true; - else if (w && FIXNUMP (Vtruncate_partial_width_windows)) - lines_truncated = - w->total_cols < XFIXNAT (Vtruncate_partial_width_windows); - else if (w && !NILP (Vtruncate_partial_width_windows)) - lines_truncated = - w->total_cols < FRAME_COLS (XFRAME (WINDOW_FRAME (w))); + else if (!NILP (Vtruncate_partial_width_windows) && w + && w->total_cols < FRAME_COLS (XFRAME (WINDOW_FRAME (w)))) + { + if (FIXNUMP (Vtruncate_partial_width_windows)) + lines_truncated = + w->total_cols < XFIXNAT (Vtruncate_partial_width_windows); + else + lines_truncated = true; + } /* Special optimization for buffers with long and truncated lines: assumes that each character is a single column. */ if (lines_truncated) --=-=-=--
X-Loop: help-debbugs@HIDDEN Subject: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect Resent-From: Juri Linkov <juri@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sat, 27 Aug 2022 19:53:02 +0000 Resent-Message-ID: <handler.56815.B56815.16616299715019 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 56815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN> Cc: larsi@HIDDEN, 56815 <at> debbugs.gnu.org, gregory@HIDDEN Received: via spool by 56815-submit <at> debbugs.gnu.org id=B56815.16616299715019 (code B ref 56815); Sat, 27 Aug 2022 19:53:02 +0000 Received: (at 56815) by debbugs.gnu.org; 27 Aug 2022 19:52:51 +0000 Received: from localhost ([127.0.0.1]:57144 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oS1rP-0001It-Gs for submit <at> debbugs.gnu.org; Sat, 27 Aug 2022 15:52:51 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:43781) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1oS1rN-0001If-Gq for 56815 <at> debbugs.gnu.org; Sat, 27 Aug 2022 15:52:50 -0400 Received: (Authenticated sender: juri@HIDDEN) by mail.gandi.net (Postfix) with ESMTPSA id C5B94E0002; Sat, 27 Aug 2022 19:52:41 +0000 (UTC) From: Juri Linkov <juri@HIDDEN> In-Reply-To: <86bksaoqfv.fsf@HIDDEN> (Juri Linkov's message of "Tue, 23 Aug 2022 19:49:40 +0300") Organization: LINKOV.NET References: <83mtct87ti.fsf@HIDDEN> <bf6b6a6fd369cd74b0fd@HIDDEN> <83bkt77nf9.fsf@HIDDEN> <bf6b6a6fd31548b3d6c5@HIDDEN> <83a68r7m2d.fsf@HIDDEN> <bf6b6a6fd3f0eaf40602@HIDDEN> <837d3v7kr9.fsf@HIDDEN> <bf6b6a6fd35ae2bb3303@HIDDEN> <86fsih5bch.fsf@HIDDEN> <83wnbs2nc3.fsf@HIDDEN> <86y1w7bzum.fsf@HIDDEN> <83r11jj5ht.fsf@HIDDEN> <86v8qlljwp.fsf@HIDDEN> <83k071bk6z.fsf@HIDDEN> <86edx9fmgb.fsf@HIDDEN> <83fshpbdab.fsf@HIDDEN> <86sfloixio.fsf@HIDDEN> <838rngbjke.fsf@HIDDEN> <86zgfvie26.fsf@HIDDEN> <83o7wb88ht.fsf@HIDDEN> <86bksaoqfv.fsf@HIDDEN> Date: Sat, 27 Aug 2022 22:52:29 +0300 Message-ID: <86mtbpmpky.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) >>> >> (or truncate-lines (truncated-partial-width-window-p)) >>> > >>> > Fine by me. >>> >>> Then I'll push a better patch: >> >> Btw, I didn't use window-total-width instead of window-width. What I >> did mimics what the display engine does when it determines whether to >> truncate lines in a window. So I think >> truncated-partial-width-window-p should be fixed to use >> window-total-width instead. > > Now this patch fixes truncated-partial-width-window-p to use > window-total-width. Also it fixes the recent code for > long_line_optimizations_p in scan_for_column to better mimic > what the display engine does: Now pushed to master.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.