Given that the point is right in front of a comment, how do I move it to the end of the comment, but before the comment end markers?
- for a C++
// xxxcomment, I would like to move the point to the end of the line
- for C-style
/* xxx */comments I would like to move the point to right before the second
To complicate matters, I would like this to be mode independent. Also, I would like the solution to be based on the syntax table, as there are major modes that don't set up the comment-related regex variables properly.
- The function
forward-commentcan move the point the after the comment end marker, but I want it to stop before the comment end marker
- The syntax table can define three kinds of comments at the same time (where the
cflags indicate that character is part of alternative comment kinds). When the point is inside a comment, the function
syntax-ppsscan tell which kind of comment it is.