From 07f10bab2be80fce47700c6985c304cf04e3d4f5 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 9 May 2003 20:09:04 +0000 Subject: [PATCH] (comment-indent): Be more careful when inserting the space, and insert it before setting `begpos'. --- lisp/newcomment.el | 4 ++-- 1 file 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))) -- 2.11.4.GIT