all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan <monnier@iro.umontreal.ca>
Cc: Karl Chen <quarl@nospam.quarl.org>, emacs-devel@gnu.org
Subject: Re: jit-lock.el
Date: Sun, 10 Oct 2004 01:32:20 -0400	[thread overview]
Message-ID: <m1fz4nmbpu.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <E1Be0Zz-0008Dl-Q6@fencepost.gnu.org> (Richard Stallman's message of "Fri, 25 Jun 2004 19:57:59 -0400")

> Is anyone investigating this bug report?

I just looked at it.

> To: emacs-devel@gnu.org
> From: Karl Chen <quarl@nospam.quarl.org>
> 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);

      parent reply	other threads:[~2004-10-10  5:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-25 23:57 jit-lock.el Richard Stallman
2004-06-30 14:08 ` jit-lock.el Stefan
2004-07-01 17:14   ` jit-lock.el Richard Stallman
2004-07-01 17:51     ` jit-lock.el Stefan
2004-07-01 20:59       ` jit-lock.el David Kastrup
2004-10-10  5:32 ` Stefan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1fz4nmbpu.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=quarl@nospam.quarl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.