[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems with syntax-ppss: Was [... Apply `comment-depth' text prope

From: Alan Mackenzie
Subject: Re: Problems with syntax-ppss: Was [... Apply `comment-depth' text properties when calling `back_comment'.]
Date: Fri, 11 Mar 2016 23:08:55 +0000
User-agent: Mutt/1.5.24 (2015-08-30)

Hello, Stefan.

On Fri, Mar 11, 2016 at 05:35:05PM -0500, Stefan Monnier wrote:
> > OK.  It wouldn't compile, so I had to correct it a little bit.

> Hmm... I've seen your arrows but they weren't sufficient to make me see
> what it was you needed to change.

> > ............"   "...." /*  "...."   */   /*  */   /*               */
> > |                               |                           |
> > point-min           return value of syntax-ppss            pos

> Give me a non-artificial recipe where this happens, and I'll think about
> how it should best be solved.

No.  (forward-comment -n) must work with any comments, artificial or
not.  Here's a line out of a C file to help with your testing:

    char foo[] = "asdf asdf" "asdf"; /* "asdf" */ /*  */  /*   '"'"  */

.  Narrow the buffer so that point-min is at the indicated position,
then try to get (forward-comment -1) from EOL working.

But it won't help you much.  On calling syntax-ppss, find_defun_start
cannot know whether point-min is inside a string or not.  When it is,
the parse state returned is useless.

Like I keep telling you, syntax-ppss is not suitable for use in
back_comment.  Sooner or later, you must come to accept that I am right.

All the time, my new code in branch comment-cache copes with the above
situation, and all other situations, without difficulty.

>         Stefan

Alan Mackenzie (Nuremberg, Germany).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]