From: Karl Heuer Date: Mon, 29 May 1995 06:19:46 +0000 (+0000) Subject: (indent-for-comment): move to beginning of line only X-Git-Tag: emacs-19.34~3883 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6389928d1b72f6e3f4ecf45c09c33a78b0d0c162;p=emacs.git (indent-for-comment): move to beginning of line only if there is a comment syntax. --- 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.