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 (* as a comment. This matches your explanation, but I don't think the solution applies to that case. Clément.