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: [rudalics@gmx.at: Re: jit lock sit-for provokes redisplay provokes imenu] Date: Tue, 29 Aug 2006 23:41:19 -0400 Message-ID: References: <8764gcde3n.fsf@stupidchicken.com> <878xl754fy.fsf@furball.mit.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1156909307 28402 80.91.229.2 (30 Aug 2006 03:41:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 30 Aug 2006 03:41:47 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 30 05:41:45 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GIGxM-0001bS-L7 for ged-emacs-devel@m.gmane.org; Wed, 30 Aug 2006 05:41:36 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GIGxM-000266-4l for ged-emacs-devel@m.gmane.org; Tue, 29 Aug 2006 23:41:36 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GIGxA-000255-1x for emacs-devel@gnu.org; Tue, 29 Aug 2006 23:41:24 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GIGx8-00023k-8b for emacs-devel@gnu.org; Tue, 29 Aug 2006 23:41:23 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GIGx8-00023P-2Z for emacs-devel@gnu.org; Tue, 29 Aug 2006 23:41:22 -0400 Original-Received: from [209.226.175.74] (helo=tomts20-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GIH6Q-0000VY-N9; Tue, 29 Aug 2006 23:50:58 -0400 Original-Received: from localhost ([70.55.145.157]) by tomts20-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20060830034120.ZWPO16051.tomts20-srv.bellnexxia.net@localhost>; Tue, 29 Aug 2006 23:41:20 -0400 Original-Received: by localhost (Postfix, from userid 20848) id EDEF38E4E; Tue, 29 Aug 2006 23:41:19 -0400 (EDT) Original-To: Chong Yidong In-Reply-To: <878xl754fy.fsf@furball.mit.edu> (Chong Yidong's message of "Tue, 29 Aug 2006 22:43:13 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:59094 Archived-At: > How about this? It adds jit-lock-pre-stealth-fontify-hook and > jit-lock-post-stealth-fontify-hook, which are normal hooks run before > and after each chunk of stealth fontification. Then imenu can use > this to avoid menu bar updates resulting from stealth fontification. This only eliminates one particular source of unwanted updates. I don't think this code is worth the trouble. At the very least, add it to font-lock rather than jit-lock. Better yet, introduce a macro `with-buffer-unmodified' like the one used in jit-lock, and make it manage a `buffer-really-modified-tick', kind of like the buffer-chars-modified-tick. Then use it in jit-lock/font-lock and friends. Stefan PS: And make sure it also works when nested ;-)