aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1997-11-15 21:14:21 +0000
committerKarl Heuer1997-11-15 21:14:21 +0000
commit3fb7b5883f37263955def0d98ca21d1d5697f56a (patch)
tree8125abab8de7828b474ad329114640d143fb2b92
parent35863d776f04e2eddfee7799d49e148d130cf05d (diff)
downloademacs-3fb7b5883f37263955def0d98ca21d1d5697f56a.tar.gz
emacs-3fb7b5883f37263955def0d98ca21d1d5697f56a.zip
(comment-padding): New var.
(comment-region): Use it.
-rw-r--r--lisp/simple.el9
1 files changed, 9 insertions, 0 deletions
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."
2488 (if arg (forward-line 1)) 2488 (if arg (forward-line 1))
2489 (setq count (1- count))))) 2489 (setq count (1- count)))))
2490 2490
2491(defvar comment-padding 1
2492 "Number of spaces `comment-region' puts between comment chars and text.
2493
2494Extra spacing between the comment characters and the comment text
2495makes the comment easier to read. Default is 1. Nil means 0 and is
2496more efficient.")
2497
2491(defun comment-region (beg end &optional arg) 2498(defun comment-region (beg end &optional arg)
2492 "Comment or uncomment each line in the region. 2499 "Comment or uncomment each line in the region.
2493With just C-u prefix arg, uncomment each line in region. 2500With just C-u prefix arg, uncomment each line in region.
@@ -2514,6 +2521,8 @@ not end the comment. Blank lines do not get comments."
2514 (setq cs (concat cs comment-start) 2521 (setq cs (concat cs comment-start)
2515 ce (concat ce comment-end)) 2522 ce (concat ce comment-end))
2516 (setq numarg (1- numarg)))) 2523 (setq numarg (1- numarg))))
2524 (when comment-padding
2525 (setq cs (concat cs (make-string comment-padding ? ))))
2517 ;; Loop over all lines from BEG to END. 2526 ;; Loop over all lines from BEG to END.
2518 (narrow-to-region beg end) 2527 (narrow-to-region beg end)
2519 (goto-char beg) 2528 (goto-char beg)