changeset 20265:37a6af24de93

(comment-padding): New var. (comment-region): Use it.
author Karl Heuer <kwzh@gnu.org>
date Sat, 15 Nov 1997 21:14:21 +0000
parents 3b9b07f3eab5
children 450fdcb00733
files lisp/simple.el
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/simple.el	Sat Nov 15 21:04:47 1997 +0000
+++ b/lisp/simple.el	Sat Nov 15 21:14:21 1997 +0000
@@ -2488,6 +2488,13 @@
       (if arg (forward-line 1))
       (setq count (1- count)))))
 
+(defvar comment-padding 1
+  "Number of spaces `comment-region' puts between comment chars and text.
+
+Extra spacing between the comment characters and the comment text
+makes the comment easier to read.  Default is 1.  Nil means 0 and is
+more efficient.")
+
 (defun comment-region (beg end &optional arg)
   "Comment or uncomment each line in the region.
 With just C-u prefix arg, uncomment each line in region.
@@ -2514,6 +2521,8 @@
 	    (setq cs (concat cs comment-start)
 		  ce (concat ce comment-end))
 	    (setq numarg (1- numarg))))
+	(when comment-padding
+	  (setq cs (concat cs (make-string comment-padding ? ))))
 	;; Loop over all lines from BEG to END.
         (narrow-to-region beg end)
         (goto-char beg)