aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1995-05-29 06:19:46 +0000
committerKarl Heuer1995-05-29 06:19:46 +0000
commit6389928d1b72f6e3f4ecf45c09c33a78b0d0c162 (patch)
tree387d6ff4f8e5f769d2f3e217f2fc6e4091709013
parent5bb52971123d1576e240af685af9264f3990f3b0 (diff)
downloademacs-6389928d1b72f6e3f4ecf45c09c33a78b0d0c162.tar.gz
emacs-6389928d1b72f6e3f4ecf45c09c33a78b0d0c162.zip
(indent-for-comment): move to beginning of line only
if there is a comment syntax.
-rw-r--r--lisp/simple.el2
1 files changed, 1 insertions, 1 deletions
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.")
1992(defun indent-for-comment () 1992(defun indent-for-comment ()
1993 "Indent this line's comment to comment column, or insert an empty comment." 1993 "Indent this line's comment to comment column, or insert an empty comment."
1994 (interactive "*") 1994 (interactive "*")
1995 (beginning-of-line 1)
1996 (let* ((empty (save-excursion (beginning-of-line) 1995 (let* ((empty (save-excursion (beginning-of-line)
1997 (looking-at "[ \t]*$"))) 1996 (looking-at "[ \t]*$")))
1998 (starter (or (and empty block-comment-start) comment-start)) 1997 (starter (or (and empty block-comment-start) comment-start))
@@ -2001,6 +2000,7 @@ If nil, use `comment-end' instead.")
2001 (error "No comment syntax defined") 2000 (error "No comment syntax defined")
2002 (let* ((eolpos (save-excursion (end-of-line) (point))) 2001 (let* ((eolpos (save-excursion (end-of-line) (point)))
2003 cpos indent begpos) 2002 cpos indent begpos)
2003 (beginning-of-line)
2004 (if (re-search-forward comment-start-skip eolpos 'move) 2004 (if (re-search-forward comment-start-skip eolpos 'move)
2005 (progn (setq cpos (point-marker)) 2005 (progn (setq cpos (point-marker))
2006 ;; Find the start of the comment delimiter. 2006 ;; Find the start of the comment delimiter.