Commit 6389928d authored by Karl Heuer's avatar Karl Heuer
Browse files

(indent-for-comment): move to beginning of line only

if there is a comment syntax.
parent 5bb52971
......@@ -1992,7 +1992,6 @@ If nil, use `comment-end' instead.")
(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))
......@@ -2001,6 +2000,7 @@ If nil, use `comment-end' instead.")
(error "No comment syntax defined")
(let* ((eolpos (save-excursion (end-of-line) (point)))
cpos indent begpos)
(if (re-search-forward comment-start-skip eolpos 'move)
(progn (setq cpos (point-marker))
;; Find the start of the comment delimiter.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment