+(defun pspp-comment-p ()
+ "Returns t if point is in a comment. Nil otherwise."
+ (if (pspp-data-block-p)
+ nil
+ (let (
+ (pspp-comment-start-found nil)
+ (pspp-comment-end-found nil)
+ (pspp-single-line-comment nil)
+ (lines 1)
+ )
+ (save-excursion
+ (end-of-line)
+ (while (and (>= lines 0)
+ (not pspp-comment-start-found)
+ (not pspp-comment-end-found)
+ )
+ (beginning-of-line)
+ (if (pspp-comment-start-line-p) (set 'pspp-comment-start-found t))
+ (if (bobp)
+ (set 'pspp-comment-end-found nil)
+ (save-excursion
+ (forward-line -1)
+ (if (pspp-comment-end-line-p) (set 'pspp-comment-end-found t))
+ )
+ )
+ (set 'lines (forward-line -1))
+ )
+ )
+
+ (save-excursion
+ (set 'pspp-single-line-comment (and
+ (pspp-comment-start-line-p)
+ (pspp-comment-end-line-p)))
+ )
+