From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: jit-lock refontifies too much Date: Tue, 27 Sep 2005 11:54:24 -0400 Message-ID: References: <43251F5E.9040601@gmx.at> <873boa8l30.fsf-monnier+emacs@gnu.org> <4327B9C9.30406@gmx.at> <87oe6vx4he.fsf-monnier+emacs@gnu.org> <433126E3.1030905@gmx.at> <433254BF.8040205@gmx.at> <87ll1pvwyl.fsf-monnier+emacs@gnu.org> <4336A37C.70002@gmx.at> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1127837390 6665 80.91.229.2 (27 Sep 2005 16:09:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 27 Sep 2005 16:09:50 +0000 (UTC) Cc: martin rudalics , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 27 18:09:47 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EKI1E-0008IR-NQ for ged-emacs-devel@m.gmane.org; Tue, 27 Sep 2005 18:09:26 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EKI1E-0002Vk-0H for ged-emacs-devel@m.gmane.org; Tue, 27 Sep 2005 12:09:24 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EKHzN-0001Y8-Ci for emacs-devel@gnu.org; Tue, 27 Sep 2005 12:07:29 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EKHzM-0001Xa-7i for emacs-devel@gnu.org; Tue, 27 Sep 2005 12:07:28 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EKHxC-0000I6-Lt for emacs-devel@gnu.org; Tue, 27 Sep 2005 12:05:15 -0400 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EKHmo-0000s0-Ap; Tue, 27 Sep 2005 11:54:30 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 4749B2CF5FE; Tue, 27 Sep 2005 11:54:29 -0400 (EDT) Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 2BC834AC00A; Tue, 27 Sep 2005 11:54:25 -0400 (EDT) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id 0F510F69C4; Tue, 27 Sep 2005 11:54:25 -0400 (EDT) Original-To: rms@gnu.org In-Reply-To: (Richard M. Stallman's message of "Mon, 26 Sep 2005 19:56:36 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-4.847, requis 5, autolearn=not spam, AWL 0.05, BAYES_00 -4.90) X-MailScanner-From: monnier@iro.umontreal.ca X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:43290 Archived-At: > That would be overly expensive. I rewrote all this with ppss, two > markers, a before-change-functions hook and without any text properties. > It seems to work but needs some further testing. > That is interesting. I would not have expected it to work. > However, this would require doing that computation for each change, > and that could be rather expensive, right? Shouldn't be particularly expensive: syntax-ppss is called by font-lock anyway, and since it uses caching, calling it a couple more times around the same spot is pretty cheap. > One advantage for the idea of saving it in a text property for the > first character on each line is that it only has to be checked > when it is time to refontify. What his patch does is pretty much the same except he uses before-change-functions in order to lazily only store the syntax-ppss of the line after the change, whereas you'd eagerly store it for every line in the buffer. > Another possible advantage is: if things are not in sync for the first > line after the end of the changed text, it might be in sync on a > subsequent line, and that could avoid refontifying most of the lines > on the screen. My gut feeling is that this is way past the point of diminishing returns. Already his optimization is rarely noticeable, but breaks a couple (rare) special cases. Stefan