From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Newsgroups: gmane.emacs.devel Subject: Re: jit-lock.el Date: Sun, 10 Oct 2004 01:32:20 -0400 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1097386375 15980 80.91.229.6 (10 Oct 2004 05:32:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 10 Oct 2004 05:32:55 +0000 (UTC) Cc: Karl Chen , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 10 07:32:37 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CGWJx-0006QE-00 for ; Sun, 10 Oct 2004 07:32:37 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CGWQp-0001Ut-9k for ged-emacs-devel@m.gmane.org; Sun, 10 Oct 2004 01:39:43 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CGWQi-0001Uo-4x for emacs-devel@gnu.org; Sun, 10 Oct 2004 01:39:36 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CGWQh-0001Uc-NY for emacs-devel@gnu.org; Sun, 10 Oct 2004 01:39:35 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CGWQh-0001UZ-LT for emacs-devel@gnu.org; Sun, 10 Oct 2004 01:39:35 -0400 Original-Received: from [206.47.199.141] (helo=simmts12-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CGWJe-0001zO-PI; Sun, 10 Oct 2004 01:32:19 -0400 Original-Received: from empanada.home ([70.48.80.6]) by simmts12-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20041010053057.YLYS1580.simmts12-srv.bellnexxia.net@empanada.home>; Sun, 10 Oct 2004 01:30:57 -0400 Original-Received: by empanada.home (Postfix, from userid 502) id 2DC423183F9; Sun, 10 Oct 2004 01:32:21 -0400 (EDT) Original-To: rms@gnu.org In-Reply-To: (Richard Stallman's message of "Fri, 25 Jun 2004 19:57:59 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (darwin) 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: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:28168 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:28168 > Is anyone investigating this bug report? I just looked at it. > To: emacs-devel@gnu.org > From: Karl Chen > Date: Tue, 22 Jun 2004 01:43:16 -0700 > Subject: another jit-lock bug > Reply-To: quarl+dated+1088325557.3e362f@nospam.quarl.org > Sender: emacs-devel-bounces+rms=gnu.org@gnu.org > emacs -q > (global-set-key "\r" (lambda () (interactive) (newline) > (indent-according-to-mode))) > (global-font-lock-mode) > (setq font-lock-support-mode 'jit-lock-mode) > C-x C-f /tmp/a.sh > if true ; then > # when you press return here, auto indent succeeds > fi > case z in > asdf) > # auto indent fails here only when font-lock-support-mode is > # jit-lock-mode, using (indent-according-to-mode) as part of an # interactive key (if you manually evaluate # (indent-according-to-mode) it works) Here's what happens. The `)' right after `asdf' has a syntax-table text property of ".". If you put point right after it and do (newline), the newline you inset inherits the "." property. That incorrect property is removed next time font-lock is invoked, i.e. immediately (with font-lock-support-mode) or after the current command is finished (without font-lock-support-mode). If you call indent-according-to-mode as part of the same command, the indentation code gets confused by this transient newline-with-punctuation-syntax. I think the best solution is the one below. Any objection? I really can't think of any case where the syntax-table text-property should be sticky, but it may just be a lack of imagination. Stefan --- textprop.c 18 May 2004 10:10:08 -0400 1.138 +++ textprop.c 10 Oct 2004 01:23:30 -0400 @@ -1,5 +1,5 @@ /* Interface code for dealing with text properties. - Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003 + Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -2233,7 +2233,9 @@ the character doesn't inherit PROPERTY if NONSTICKINESS is non-nil, inherits it if NONSTICKINESS is nil. The front-sticky and rear-nonsticky properties of the character overrides NONSTICKINESS. */); - Vtext_property_default_nonsticky = Qnil; + /* Text property `syntax-table' should be nonsticky by default. */ + Vtext_property_default_nonsticky + = Fcons (Fcons (intern ("syntax-table"), Qt), Qnil); staticpro (&interval_insert_behind_hooks); staticpro (&interval_insert_in_front_hooks);