emacs-devel
[Top][All Lists]
Advanced

[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: Stefan Monnier
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: Thu, 10 Mar 2016 10:20:24 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

> Thanks for the clarification. What's the recommended way to check if the
> point is in a comment, then? I'm thinking for example of adjusting
> fill-nobreak-predicate, or similar things.

The recommended way is

   (nth 8 (syntax-ppss))

Whether "/<point>*" is inside the comment or not is very debatable, and
luckily it rarely matters.  So if/when it matters and syntax-ppss's
answer isn't the one we need, then we can discuss the better replacement
for that specific case, but the specifics will matter then.


        Stefan




reply via email to

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