From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Re: cc-mode fontification feels random Date: Mon, 30 Aug 2021 12:28:01 -0700 Message-ID: <9377d9ec-a3e5-ceea-8a9a-523a420f13f7@dancol.org> References: <835yvmka50.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37858"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 Cc: emacs-devel@gnu.org To: Eli Zaretskii , Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Aug 30 21:36:26 2021 Return-path: Envelope-to: ged-emacs-devel@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 1mKn4z-0009ez-9s for ged-emacs-devel@m.gmane-mx.org; Mon, 30 Aug 2021 21:36:25 +0200 Original-Received: from localhost ([::1]:49528 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mKn4y-0007Mq-45 for ged-emacs-devel@m.gmane-mx.org; Mon, 30 Aug 2021 15:36:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54900) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mKmwy-0002l1-5c for emacs-devel@gnu.org; Mon, 30 Aug 2021 15:28:09 -0400 Original-Received: from dancol.org ([2600:3c01:e000:3d8::1]:56960) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mKmwv-0005Dm-Q6; Mon, 30 Aug 2021 15:28:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Sender:Reply-To: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=xR/9wcsMQ35agFi29qbfuZdm+dvgfcs32ZC9e7uQQyk=; b=a5GXHC/koQFyVPSUXscFaONB2W 5VcHVBaIv8p0T10hY9EWgPpLwqWcVZ6adzXBKPTliMWe4EDC9X3VulhPFbzC7tRV2Js7P8Mzm1prp PcbiuZ5bre4tP7PRVZ02zO8j8/dYfP7zGPk2ALlcZdysTYmmqXoC0qLXQUysZJulZrhlViDzUGKhR XI1ja9Kts9o03MnJukgOazlDx64os9Z65ViAEpl4IehIJd484OhwkGXhh0yJ3pfIX1mjdFZ3A5iPH XeiG/th2Glj27Q/fJsGBgYlkesg0afr8wU4rt4stzlpC+HjZ+XwJghFCF4MxNdbTHZyHkv6AJZ13N WP3KcUEA==; Original-Received: from [2604:4080:1321:8020:2761:c5fe:e373:3ed] (port=43552) by dancol.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1mKmwr-00056i-OI; Mon, 30 Aug 2021 12:28:01 -0700 In-Reply-To: <835yvmka50.fsf@gnu.org> Content-Language: en-US Received-SPF: pass client-ip=2600:3c01:e000:3d8::1; envelope-from=dancol@dancol.org; helo=dancol.org X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.932, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:273542 Archived-At: On 8/30/21 12:25 PM, Eli Zaretskii wrote: >> Date: Mon, 30 Aug 2021 18:50:34 +0000 >> From: Alan Mackenzie >> Cc: emacs-devel@gnu.org >> >> The following patch is an attempt to improve this situation. It is best >> used with jit-stealth-lock enabled. I have tried it out with the >> following settings: >> >> jit-lock-stealth-load: 200 ; i.e. inactive. >> jit-lock-stealth-nice: 0.1 ; 100 ms between fontifying stealth >> chunks. >> jit-lock-stealth-time: 1 ; 1 second idle time before stealth kicks >> in. >> >> Whenever a new found type is entered into the CC Mode table, it marks >> all occurrences of the type in the buffer for fontification (by setting >> the 'fontified text property to nil on it), and causes an immediate >> redisplay when there are occurrences of the new type in a window. > So you are saying that this will cause the display of the visible > portion of the window to flicker whenever jit-lock-stealth finds such > a "new type"? That could annoy, can't it? jit-lock-stealth is for > fontifying portions of the buffer(s) that are not on display, it would > be wrong for it to apply this enhancement, I think, certainly by > default. Any literal "flicker" issues should have been fixed for a long time now. What do you mean? That the fontification might change? That happens anyway. > > And jit-lock-stealth-time of 1 sec is too short. I use 16, because > once jit-lock-stealth starts fontifying a chunk, Emacs can be > relatively slow to react to keyboard input, so I prefer to let > jit-lock-stealth start its thing only when there's a very good chance > I indeed stopped typing, not just thinking about something for a > second or two. Isn't this problem what while-no-input is intended to prevent? >> I think stealth lock could be enhanced by having it fontify several >> 500-byte chunks together, say until 0.05s time has been taken up. This >> could speed up stealth fontification while still leaving the keyboard >> responsive to the user. > Users can already arrange for that by manipulating the > jit-stealth-lock parameters. Why should we change code to force upon > everyone what seems like a good idea to you (but isn't a good idea > IME, see above)? If you want that, you can easily arrange for Emacs > to behave like that without changing any code. Because good defaults matter, and if we have proper input preemption of stealth JIT working, there should be no downside.