changeset 49768:ffe55e61c3fc

(comment-indent): Ensure space before added comment.
author Dave Love <fx@gnu.org>
date Thu, 13 Feb 2003 15:54:19 +0000
parents 4a50d348a2b1
children 5ed59fd23bc4
files lisp/newcomment.el
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/newcomment.el	Thu Feb 13 13:15:45 2003 +0000
+++ b/lisp/newcomment.el	Thu Feb 13 15:54:19 2003 +0000
@@ -473,6 +473,10 @@
 	    ;; 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)))
+	      (insert ?\ ))
 	    (insert starter)
 	    (setq cpos (point-marker))
 	    (insert ender)))