From: Stefan Monnier Date: Fri, 9 May 2003 20:09:04 +0000 (+0000) Subject: (comment-indent): Be more careful when inserting X-Git-Tag: ttn-vms-21-2-B4~10219 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=07f10bab2be80fce47700c6985c304cf04e3d4f5;p=emacs.git (comment-indent): Be more careful when inserting the space, and insert it before setting `begpos'. --- 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)))