if there is a comment syntax.
(defun indent-for-comment ()
"Indent this line's comment to comment column, or insert an empty comment."
(interactive "*")
- (beginning-of-line 1)
(let* ((empty (save-excursion (beginning-of-line)
(looking-at "[ \t]*$")))
(starter (or (and empty block-comment-start) comment-start))
(error "No comment syntax defined")
(let* ((eolpos (save-excursion (end-of-line) (point)))
cpos indent begpos)
+ (beginning-of-line)
(if (re-search-forward comment-start-skip eolpos 'move)
(progn (setq cpos (point-marker))
;; Find the start of the comment delimiter.