# HG changeset patch # User Stefan Monnier # Date 1052510944 0 # Node ID 068965f379b32629a3f1a1bbe900bdc0efcd0052 # Parent dc235df7e2264a5560f619eaad4aea2fe7d50850 (comment-indent): Be more careful when inserting the space, and insert it before setting `begpos'. diff -r dc235df7e226 -r 068965f379b3 lisp/newcomment.el --- a/lisp/newcomment.el Fri May 09 17:05:40 2003 +0000 +++ b/lisp/newcomment.el Fri May 09 20:09:04 2003 +0000 @@ -481,11 +481,11 @@ ;; 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)))