From 3fb7b5883f37263955def0d98ca21d1d5697f56a Mon Sep 17 00:00:00 2001 From: Karl Heuer Date: Sat, 15 Nov 1997 21:14:21 +0000 Subject: [PATCH] (comment-padding): New var. (comment-region): Use it. --- lisp/simple.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lisp/simple.el b/lisp/simple.el index a33f0111d8f..c8c3c9fc52f 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2488,6 +2488,13 @@ With argument, kill comments on that many lines starting with this one." (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 @@ not end the comment. Blank lines do not get comments." (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) -- 2.39.2