[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How do you check if the current point is in a comment or a string? (
From: |
Clément Pit--Claudel |
Subject: |
Re: How do you check if the current point is in a comment or a string? (Was Re: Problems with syntax-ppss: Was [... Apply `comment-depth' text properties when calling `back_comment'.]) |
Date: |
Wed, 9 Mar 2016 14:34:37 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 |
On 03/09/2016 02:19 PM, Kaushal Modi wrote:
> You are correct; it does not work if the point is before the first
> comment character. That makes sense if you visualize syntax-ppss to
> look at the chars ONLY up to the point. I never faced this case in my
> application.
>
> May be have a combination of looking-at comment-start or double quote
> (") and syntax-ppss?
Thanks for the suggestion!
Even then, I don't think this works in CC-mode, or in any language that has
two-character comment markers: it works in Lisp because the comment marker is a
single semicolon. But in OCaml, for example, (* is a comment marker and
syntax-ppss doesn't see (<point>* as a comment. This matches your explanation,
but I don't think the solution applies to that case.
Clément.
signature.asc
Description: OpenPGP digital signature
- Re: Problems with syntax-ppss: Was [... Apply `comment-depth' text properties when calling `back_comment'.], (continued)
- Re: Problems with syntax-ppss: Was [... Apply `comment-depth' text properties when calling `back_comment'.], Dmitry Gutov, 2016/03/11
- Re: Problems with syntax-ppss: Was [... Apply `comment-depth' text properties when calling `back_comment'.], Andreas Röhler, 2016/03/12
- Re: Problems with syntax-ppss: Was [... Apply `comment-depth' text properties when calling `back_comment'.], Dmitry Gutov, 2016/03/12
- Re: Problems with syntax-ppss: Was [... Apply `comment-depth' text properties when calling `back_comment'.], Alan Mackenzie, 2016/03/12
- Re: Problems with syntax-ppss: Was [... Apply `comment-depth' text properties when calling `back_comment'.], Andreas Röhler, 2016/03/13
- Re: Problems with syntax-ppss: Was [... Apply `comment-depth' text properties when calling `back_comment'.], Stefan Monnier, 2016/03/10
- How do you check if the current point is in a comment or a string? (Was Re: Problems with syntax-ppss: Was [... Apply `comment-depth' text properties when calling `back_comment'.]), Clément Pit--Claudel, 2016/03/09
- Re: How do you check if the current point is in a comment or a string? (Was Re: Problems with syntax-ppss: Was [... Apply `comment-depth' text properties when calling `back_comment'.]), Kaushal Modi, 2016/03/09
- Re: How do you check if the current point is in a comment or a string? (Was Re: Problems with syntax-ppss: Was [... Apply `comment-depth' text properties when calling `back_comment'.]), Clément Pit--Claudel, 2016/03/09
- Re: How do you check if the current point is in a comment or a string? (Was Re: Problems with syntax-ppss: Was [... Apply `comment-depth' text properties when calling `back_comment'.]), Kaushal Modi, 2016/03/09
- Re: How do you check if the current point is in a comment or a string? (Was Re: Problems with syntax-ppss: Was [... Apply `comment-depth' text properties when calling `back_comment'.]),
Clément Pit--Claudel <=
- Re: How do you check if the current point is in a comment or a string? (Was Re: Problems with syntax-ppss: Was [... Apply `comment-depth' text properties when calling `back_comment'.]), Stefan Monnier, 2016/03/10
- Re: How do you check if the current point is in a comment or a string? (Was Re: Problems with syntax-ppss: Was [... Apply `comment-depth' text properties when calling `back_comment'.]), Clément Pit--Claudel, 2016/03/10
- Re: How do you check if the current point is in a comment or a string? (Was Re: Problems with syntax-ppss: Was [... Apply `comment-depth' text properties when calling `back_comment'.]), Stefan Monnier, 2016/03/10
- Re: How do you check if the current point is in a comment or a string? (Was Re: Problems with syntax-ppss: Was [... Apply `comment-depth' text properties when calling `back_comment'.]), Clément Pit--Claudel, 2016/03/10
- Re: How do you check if the current point is in a comment or a string? (Was Re: Problems with syntax-ppss: Was [... Apply `comment-depth' text properties when calling `back_comment'.]), Andreas Röhler, 2016/03/12
- Re: How do you check if the current point is in a comment or a string? (Was Re: Problems with syntax-ppss: Was [... Apply `comment-depth' text properties when calling `back_comment'.]), Clément Pit--Claudel, 2016/03/12
Re: [Emacs-diffs] comment-cache 223d16f 2/3: Apply `comment-depth' text properties when calling `back_comment'., Richard Stallman, 2016/03/09