diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2003-05-09 20:09:04 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2003-05-09 20:09:04 +0000 |
commit | 019767751124f9de7957e92460b69fdfd22fc317 (patch) | |
tree | c27d41a8df398a4ffd3dbbb92311865b43920790 /lisp/newcomment.el | |
parent | dc08a6cbc94839bac6235faae74dc3a6fdbc424f (diff) | |
download | emacs-019767751124f9de7957e92460b69fdfd22fc317.tar.gz |
(comment-indent): Be more careful when inserting
the space, and insert it before setting `begpos'.
Diffstat (limited to 'lisp/newcomment.el')
-rw-r--r-- | lisp/newcomment.el | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/newcomment.el b/lisp/newcomment.el index 6b6f2d0b0e8..aa58c02b237 100644 --- a/lisp/newcomment.el +++ b/lisp/newcomment.el @@ -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))) |