unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Karl Chen <quarl@hkn.eecs.berkeley.edu>
Subject: new syntax.c bug? [Re: [cvs] bug in font-lock and/or shell-script-mode]
Date: Mon, 11 Nov 2002 23:58:43 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.44.0211112350170.21673-100000@hkn.eecs.berkeley.edu> (raw)
In-Reply-To: <200211092219.gA9MJoo30267@rum.cs.yale.edu>

There's a new indenting bug in HEAD 2002-11-11. It happens in cperl-mode
but it may be caused by Stefan Monnier's recent changes to syntax.c
(because of my previous complaint)

Synposis:

  emacs -q

  C-x C-f blah

  M-x cperl-mode   (perl-mode doesn't have a problem with the following
example)

{
  {
    {
      s,[a],,;
    print 'zzz';
  }
}
}

(press TAB at each line)


the "print 'zzz'" line should be indented the same as the "s,[a],," line
but it indents one less block.



-- 
Karl Chen / quarl@quarl.org


On Sat, 9 Nov 2002, Stefan Monnier wrote:

> > This bug exists in emacs HEAD 2002-11-08 and has for at least about a
> > month, but does not exist in 21.2.
> >
> > SYnposis:
> >
> >    emacs -q
> >
> >    C-x C-f script.sh
> >
> >    echo a#\* \* \* \* \)
> >
> >    M-x font-lock-fontify-buffer
> >
> >    M-x font-lock-fontify-buffer
> >
> >
> > The first fontify works fine, but the second one emits an error "Point
> > after end of properties". If the file was not modified (saved) before,
> > this will also set the modified flag for no apparent reason.  In my setup
> > this causes very annoying behaviour with my global-font-lock, version
> > control and after-rvert hooks.
> >
> >
> > I don't know what exactly about that line with the backslashes screws up
> > emacs' parser. For example removing one of the "\*" or changing the "\)"
> > will get rid of the bug. The example line given is as much as I could
> > reduce from a 'find' command line. This bug happens not unoften.
> >
> > Regardless of whether the line is correct shell syntax or not, emacs
> > should not prevent you from fontifying or saving it.
>
> I don't quite understand how this bug works.  The patch below seems
> to fix it, but makes me wonder why the problem did not appear more often
> (or even all the time).  It seems to be much older than a month,
> so it was probably hidden before.
>
>
> 	Stefan
>
>
> Index: src/syntax.c
> ===================================================================
> RCS file: /cvsroot/emacs/emacs/src/syntax.c,v
> retrieving revision 1.157
> diff -u -r1.157 syntax.c
> --- src/syntax.c	30 Oct 2002 19:17:31 -0000	1.157
> +++ src/syntax.c	9 Nov 2002 22:14:19 -0000
> @@ -2504,10 +2504,10 @@
>  #define INC_FROM				\
>  do { prev_from = from;				\
>       prev_from_byte = from_byte; 		\
> +     UPDATE_SYNTAX_TABLE_FORWARD (prev_from);	\
>       prev_from_syntax				\
>         = SYNTAX_WITH_FLAGS (FETCH_CHAR (prev_from_byte)); \
>       INC_BOTH (from, from_byte);		\
> -     UPDATE_SYNTAX_TABLE_FORWARD (from);	\
>    } while (0)
>
>    immediate_quit = 1;
> @@ -2627,6 +2620,7 @@
>       else if (from < end)
>  	if (SYNTAX_FLAGS_COMSTART_FIRST (prev_from_syntax))
>  	  if (c1 = FETCH_CHAR (from_byte),
> +	      UPDATE_SYNTAX_TABLE_FORWARD (from_byte),
>  	      SYNTAX_COMSTART_SECOND (c1))
>  	    /* Duplicate code to avoid a complex if-expression
>  	       which causes trouble for the SGI compiler.  */
>
>

       reply	other threads:[~2002-11-12  7:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200211092219.gA9MJoo30267@rum.cs.yale.edu>
2002-11-12  7:58 ` Karl Chen [this message]
2002-11-12 19:48   ` new syntax.c bug? [Re: [cvs] bug in font-lock and/or shell-script-mode] Stefan Monnier
2002-11-12 20:43   ` Stefan Monnier
2002-11-12 21:15     ` Karl Chen

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=Pine.LNX.4.44.0211112350170.21673-100000@hkn.eecs.berkeley.edu \
    --to=quarl@hkn.eecs.berkeley.edu \
    --cc=quarl@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).