Function: comment-set-column

comment-set-column is an interactive and byte-compiled function defined in newcomment.el.gz.

Signature

(comment-set-column ARG)

Documentation

Set the comment column based on point.

With no ARG, set the comment column to the current column. With just minus as arg, kill any comment on this line. With any other arg, set comment column to indentation of the previous comment
 and then align or create a comment on this line at that column.

Key Bindings

Aliases

set-comment-column

Source Code

;; Defined in /usr/src/emacs/lisp/newcomment.el.gz
;;;###autoload
(defun comment-set-column (arg)
  "Set the comment column based on point.
With no ARG, set the comment column to the current column.
With just minus as arg, kill any comment on this line.
With any other arg, set comment column to indentation of the previous comment
 and then align or create a comment on this line at that column."
  (interactive "P")
  (cond
   ((eq arg '-) (comment-kill nil))
   (arg
    (comment-normalize-vars)
    (save-excursion
      (beginning-of-line)
      (comment-search-backward)
      (beginning-of-line)
      (goto-char (comment-search-forward (line-end-position)))
      (setq comment-column (current-column))
      (message "Comment column set to %d" comment-column))
    (comment-indent))
   (t (setq comment-column (current-column))
      (message "Comment column set to %d" comment-column))))