From 6389928d1b72f6e3f4ecf45c09c33a78b0d0c162 Mon Sep 17 00:00:00 2001 From: Karl Heuer Date: Mon, 29 May 1995 06:19:46 +0000 Subject: [PATCH] (indent-for-comment): move to beginning of line only if there is a comment syntax. --- lisp/simple.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/simple.el b/lisp/simple.el index 7f2e14b3505..2c1c7cb53c5 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -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) + (beginning-of-line) (if (re-search-forward comment-start-skip eolpos 'move) (progn (setq cpos (point-marker)) ;; Find the start of the comment delimiter. -- 2.39.2