When, while executing an emacs-lisp function, point is at the beginning of a line, how can I check whether that line is part of a block comment, inside it, or starting it?
The stupid approach, that I am doing now, is to go to the first non-whitespace character and see if its face is
font-lock-comment-face or some such:
(save-excursion (skip-syntax-forward "\\s-") (let ((face (get-char-property (point) 'face))) (or (eq face 'font-lock-comment-face) (eq face 'font-lock-comment-delimiter-face) (eq face 'font-lock-doc-face))))
But this fails sometimes, because the function that invokes this might be run before fontification is performed.
Is there some standard way of doing this? (Please include, if you can, a link to the emacs lisp manual section that I've missed.)