changeset 50929:068965f379b3

(comment-indent): Be more careful when inserting the space, and insert it before setting `begpos'.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 09 May 2003 20:09:04 +0000
parents dc235df7e226
children fa1c848a9779
files lisp/newcomment.el
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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)))