]> git.eshelyaron.com Git - emacs.git/commitdiff
(comment-indent): Be more careful when inserting
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 9 May 2003 20:09:04 +0000 (20:09 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 9 May 2003 20:09:04 +0000 (20:09 +0000)
the space, and insert it before setting `begpos'.

lisp/newcomment.el

index 6b6f2d0b0e8eb23166013c61702cd488423e1eba..aa58c02b237484dd7d8af4f4130a67acdde45a90 100644 (file)
@@ -481,11 +481,11 @@ If CONTINUE is non-nil, use the `comment-continue' markers if any."
            ;; Some comment-indent-function insist on not moving comments that
            ;; are in column 0, so we first go to the likely target column.
            (indent-to comment-column)
-           (setq begpos (point))
            ;; Ensure there's a space before the comment for things
            ;; like sh where it matters (as well as being neater).
-           (unless (eq ?\  (char-syntax (char-before)))
+           (unless (memq (char-before) '(nil ?\n ?\t ?\ ))
              (insert ?\ ))
+           (setq begpos (point))
            (insert starter)
            (setq cpos (point-marker))
            (insert ender)))