From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Abrahams Newsgroups: gmane.emacs.help,gmane.emacs.devel Subject: Re: Multiline font lock questions Date: Tue, 21 Nov 2006 15:07:16 -0500 Message-ID: <87slgczhqj.fsf@pereiro.luannocracy.com> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1164139886 11832 80.91.229.2 (21 Nov 2006 20:11:26 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 21 Nov 2006 20:11:26 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Nov 21 21:11:22 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GmbxJ-0007sT-CK for geh-help-gnu-emacs@m.gmane.org; Tue, 21 Nov 2006 21:10:57 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GmbxI-00059n-OZ for geh-help-gnu-emacs@m.gmane.org; Tue, 21 Nov 2006 15:10:56 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Gmbwo-0004k0-Ma for help-gnu-emacs@gnu.org; Tue, 21 Nov 2006 15:10:26 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Gmbwn-0004iQ-U6 for help-gnu-emacs@gnu.org; Tue, 21 Nov 2006 15:10:26 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gmbwn-0004i7-HT for help-gnu-emacs@gnu.org; Tue, 21 Nov 2006 15:10:25 -0500 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1Gmbwn-0003vG-8E for help-gnu-emacs@gnu.org; Tue, 21 Nov 2006 15:10:25 -0500 Original-Received: from root by ciao.gmane.org with local (Exim 4.43) id 1GmbwQ-0007c2-Ay for help-gnu-emacs@gnu.org; Tue, 21 Nov 2006 21:10:03 +0100 Original-Received: from 216-15-125-177.c3-0.smr-ubr3.sbo-smr.ma.cable.rcn.com ([216.15.125.177]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 Nov 2006 21:10:02 +0100 Original-Received: from dave by 216-15-125-177.c3-0.smr-ubr3.sbo-smr.ma.cable.rcn.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 Nov 2006 21:10:02 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 73 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 216-15-125-177.c3-0.smr-ubr3.sbo-smr.ma.cable.rcn.com User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/23.0.0 (gnu/linux) Cancel-Lock: sha1:ooHei3vg/1jFE1TzmC8jpVEb2Ig= X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:38866 gmane.emacs.devel:62608 Archived-At: Stefan Monnier writes: Stefan, thanks for your reply. >> What does "Use" mean? I suppose "set it to non-nil," but I had to >> guess that jit-lock-contextually was a variable; I suggest a doc tweak. > > Problem is: in 99% of the cases, it's already set, so there's nothing to do > really, other than rely on it doing its job. That's why I set "use". Saying something explicit like Ensure that jit-lock-contextually is set (as it is by default) and rely on it doing its job. would be more useful >> ...This will only rehighlight the part >> of the construct that follows the actual change, and will do it >> after a short delay. This only works if the highlighting of the >> various parts of your multiline construct never depends on text in >> subsequent lines. Since `jit-lock-contextually' is activated by >> default, this can be an attractive solution. > >> That clearly wouldn't work for the example I showed above. > > Indeed. > >> * Place a `jit-lock-defer-multiline' property on the construct. >> This works only if `jit-lock-contextually' is used, but it can >> handle the case where highlighting depends on subsequent lines. > >> That seems like it could make it work. What's the advantage of using >> this method? > > Over what? `font-lock-multiline'? Any other methods you mention in this piece of doc. >> Doesn't slow down typing as much? > > Yes: the re-highlighting is delayed a little bit (see > jit-lock-context-time), so it doesn't happen after every keystroke. > For small multiline elements, it's not a big change, but for larger ones, it > can be significant. > > Another difference is that it only works if font-lock uses jit-lock. It would be great if the doc would give me the information I need in order to make an informed choice about which method to use. >> This very page links to another page describing >> font-lock-extend-after-change-region-function, which seems like it >> constitutes a fourth way to "do rehighlighting of multiline >> constructs." > > Indeed. Alan McKenzie likes this, but I would rather discourage its > use. Why does he like it, and why do you dislike it? Can we make the doc consistent, please? If there are really four ways documented, there shouldn't be a page saying there are three ways. You can always add disparaging words about the fourth way if you like. As it stands it's hard to tell whether the information even makes sense. Thanks, -- Dave Abrahams Boost Consulting www.boost-consulting.com