aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2003-05-09 20:09:04 +0000
committerStefan Monnier2003-05-09 20:09:04 +0000
commit07f10bab2be80fce47700c6985c304cf04e3d4f5 (patch)
tree750c6cee204e6684da7e4bce9f1bd94c52c186db
parentd699c8e2cf7b1f88803127ee3595f2aaf9520bc5 (diff)
downloademacs-07f10bab2be80fce47700c6985c304cf04e3d4f5.tar.gz
emacs-07f10bab2be80fce47700c6985c304cf04e3d4f5.zip
(comment-indent): Be more careful when inserting
the space, and insert it before setting `begpos'.
-rw-r--r--lisp/newcomment.el4
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."
481 ;; Some comment-indent-function insist on not moving comments that 481 ;; Some comment-indent-function insist on not moving comments that
482 ;; are in column 0, so we first go to the likely target column. 482 ;; are in column 0, so we first go to the likely target column.
483 (indent-to comment-column) 483 (indent-to comment-column)
484 (setq begpos (point))
485 ;; Ensure there's a space before the comment for things 484 ;; Ensure there's a space before the comment for things
486 ;; like sh where it matters (as well as being neater). 485 ;; like sh where it matters (as well as being neater).
487 (unless (eq ?\ (char-syntax (char-before))) 486 (unless (memq (char-before) '(nil ?\n ?\t ?\ ))
488 (insert ?\ )) 487 (insert ?\ ))
488 (setq begpos (point))
489 (insert starter) 489 (insert starter)
490 (setq cpos (point-marker)) 490 (setq cpos (point-marker))
491 (insert ender))) 491 (insert ender)))