+ ;; Stuff in the data-blocks should be untouched
+ (if (not (pspp-data-block-p)) (indent-line-to (* pspp-indent-width the-indent)))
+ )
+)
+
+
+(defun pspp-comment-start-line-p ()
+ "Returns t if the current line is the first line of a comment, nil otherwise"
+ (beginning-of-line)
+ (or (looking-at "^\*")
+ (looking-at "^[\t ]*COMMENT[\t ]")
+ )
+ )
+
+
+(defun pspp-comment-end-line-p ()
+ "Returns t if the current line is the candidate for the last line of a comment, nil otherwise"
+ (beginning-of-line)
+ (looking-at ".*\\.[\t ]*$")
+ )
+
+
+
+(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))
+ )
+ )