Mercurial > emacs
changeset 51337:0237e2420453
(comment-empty-lines): New var.
(comment-region-internal): Use it.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Fri, 30 May 2003 20:06:40 +0000 |
parents | c1252b2b2582 |
children | 950cb49c5824 |
files | lisp/newcomment.el |
diffstat | 1 files changed, 11 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/newcomment.el Fri May 30 18:52:46 2003 +0000 +++ b/lisp/newcomment.el Fri May 30 20:06:40 2003 +0000 @@ -194,6 +194,15 @@ This is obsolete because you might as well use \\[newline-and-indent]." :type 'boolean) +(defcustom comment-empty-lines nil + "If nil, `comment-region' does not comment out empty lines. +If t, it always comments out empty lines. +if `eol' it only comments out empty lines if comments are +terminated by the end of line (i.e. `comment-end' is empty)." + :type '(choice (const :tag "Never" nil) + (const :tag "Always" t) + (const :tag "EOl-terminated" 'eol))) + ;;;; ;;;; Helpers ;;;; @@ -821,7 +830,8 @@ INDENT indicates to put CS and CCS at the current indentation of the region rather than at left margin." ;;(assert (< beg end)) - (let ((no-empty t)) + (let ((no-empty (not (or (eq comment-empty-lines t) + (and comment-empty-lines (zerop (length ce))))))) ;; Sanitize CE and CCE. (if (and (stringp ce) (string= "" ce)) (setq ce nil)) (if (and (stringp cce) (string= "" cce)) (setq cce nil))