From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#57207: 29.0.50; Fontification is slow after e7b5912b23 (Improvements to long lines handling) Date: Sun, 21 Aug 2022 08:46:32 +0300 Message-ID: <83tu66cfnr.fsf@gnu.org> References: <87bksmx1j1.fsf@localhost> <8335dxiu6m.fsf@gnu.org> <87y1vnjgmn.fsf@gnus.org> <83y1vncbq5.fsf@gnu.org> <87r11fgi7h.fsf@gnus.org> <83sflvc85y.fsf@gnu.org> <87h729902w.fsf@gnus.org> <83edxdbs96.fsf@gnu.org> <87wnb5wthm.fsf@gnus.org> <83pmgxfyc7.fsf@gnu.org> <87fshtwsys.fsf@gnus.org> <877d35wsdd.fsf@gnus.org> <83ilmpfwrf.fsf@gnu.org> <8735dtwrar.fsf@gnus.org> <83h729ft60.fsf@gnu.org> <87tu68v3uu.fsf@gnus.org> <83tu68e83u.fsf@gnu.org> <87fshsteqc.fsf@gnus.org> <87bksgte5e.fsf@gnus.org> <877d34tdwf.fsf@gnus.org> <83pmgwdxhh.fsf@gnu.org> <8735dstdhn.fsf@gnus.org> <37dd2827f52038e95791@heytings.org> <83wnb2ddxd.fsf@gnu.org> <37dd2827f57a3d664931@heytings.org> <37dd2827f52c6a150684@heytings.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25304"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, 57207@debbugs.gnu.org, yantar92@gmail.com To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 21 07:47:38 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oPdoA-0006ON-1L for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 21 Aug 2022 07:47:38 +0200 Original-Received: from localhost ([::1]:60614 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oPdo9-0003dw-16 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 21 Aug 2022 01:47:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45308) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oPdna-0003dY-KP for bug-gnu-emacs@gnu.org; Sun, 21 Aug 2022 01:47:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43937) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oPdna-0002QG-C8 for bug-gnu-emacs@gnu.org; Sun, 21 Aug 2022 01:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oPdna-0007Bo-7p for bug-gnu-emacs@gnu.org; Sun, 21 Aug 2022 01:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 21 Aug 2022 05:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57207 X-GNU-PR-Package: emacs Original-Received: via spool by 57207-submit@debbugs.gnu.org id=B57207.166106080327609 (code B ref 57207); Sun, 21 Aug 2022 05:47:02 +0000 Original-Received: (at 57207) by debbugs.gnu.org; 21 Aug 2022 05:46:43 +0000 Original-Received: from localhost ([127.0.0.1]:33686 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oPdnH-0007BE-3y for submit@debbugs.gnu.org; Sun, 21 Aug 2022 01:46:43 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:53432) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oPdnE-0007B2-HY for 57207@debbugs.gnu.org; Sun, 21 Aug 2022 01:46:42 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:37238) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oPdn7-0002Nm-9M; Sun, 21 Aug 2022 01:46:34 -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=kpF+Xo0Y0cVF6V90DReJ/31lZ3egV8JPGhEhne8yEb4=; b=Ib4nbYCqJkGC gNO59dsvXeWUvhULVMhERC1ZYlpOF/yvWm16WBrggSGtW3O6jJkd1q/hX250BhxebjL9ZopWydqWe mArAzF9R572SCKW88nVmrezzeKo5Tx70btFgkW08FG4+x9EeYwnSiILcO2JudZKLgAMQ9zti2k6wK /WrgQ+w27FaWOj6mczUpAUwC1uCa19OVpOaYZ+FZaZSD0C+4jRH/Ti7OhmXsc+uIEK6kIMsMMranZ 6PGB9kqOdfGa3uyLr/9dU2Kv4IRo6WnxMxas7WASYiortfQX43eIKPam+8twAKCjpuEoIxzovpPol DuQX1uK43wnYk0f6Vlbt9Q==; Original-Received: from [87.69.77.57] (port=3322 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oPdn5-0002Uk-8G; Sun, 21 Aug 2022 01:46:32 -0400 In-Reply-To: <37dd2827f52c6a150684@heytings.org> (message from Gregory Heytings on Sat, 20 Aug 2022 23:22:23 +0000) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:240279 Archived-At: > Date: Sat, 20 Aug 2022 23:22:23 +0000 > From: Gregory Heytings > cc: larsi@gnus.org, 57207@debbugs.gnu.org, yantar92@gmail.com > > > Actually, that bug is a symptom of a problem that happens everywhere in > decode_mode_spec: whenever BEGV and ZV are used, their values could be > wrong if the calculation happens when locked narrowing is in effect. That's true, but only if redisplay is triggered while the narrowing is in effect. This is why the strategy of using narrowing as little as possible should be adhered to as meticulously as possible. Narrowing inside redisplay itself is okay, provided that it's undone before we call redisplay_mode_lines. Hooks and timer functions are especially problematic because they can run any arbitrary Lisp, and they can (and do) trigger redisplay as part of their code. > One thing I don't understand there is that in some places we use BEGV and > ZV (namely, case 'i' and case 'I'), and everywhere else we use BUF_BEGV > (b) and BUF_ZV (b). These should be equivalent given that b is set to > current_buffer, but perhaps I'm missing something. If you can be sure that b is the current buffer, then yes. > Is it also guaranteed that XBUFFER (w->contents) == current_buffer? No, not in general. Not even everywhere in redisplay_window, as I recently learned. But it is true in the low levels of the display code, the ones that use the iterator object and functions that manipulate iterators.