Function: f90-comment-indent

f90-comment-indent is a byte-compiled function defined in f90.el.gz.

Signature

(f90-comment-indent)

Documentation

Return the indentation to be used for a comment starting at point.

Used for comment-indent-function by F90 mode.
"!!!", f90-directive-comment-re, variable f90-comment-region(var)/f90-comment-region(fun) return 0.
f90-indented-comment-re (if not trailing code) calls f90-calculate-indent. All others return comment-column, leaving at least one space after code.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/f90.el.gz
(defsubst f90-comment-indent ()
  "Return the indentation to be used for a comment starting at point.
Used for `comment-indent-function' by F90 mode.
\"!!!\", `f90-directive-comment-re', variable `f90-comment-region' return 0.
`f90-indented-comment-re' (if not trailing code) calls `f90-calculate-indent'.
All others return `comment-column', leaving at least one space after code."
  (cond ((looking-at "!!!") 0)
        ((and f90-directive-comment-re
              (looking-at f90-directive-comment-re)) 0)
        ((looking-at (regexp-quote f90-comment-region)) 0)
        ((and (looking-at f90-indented-comment-re)
              ;; Don't attempt to indent trailing comment as code.
              (save-excursion
                (skip-chars-backward " \t")
                (bolp)))
         (f90-calculate-indent))
        (t (save-excursion
             (skip-chars-backward " \t")
             (max (if (bolp) 0 (1+ (current-column))) comment-column)))))