]> git.eshelyaron.com Git - emacs.git/commitdiff
Martin Rudalics <rudalics at gmx.at>
authorGlenn Morris <rgm@gnu.org>
Wed, 28 Nov 2007 05:20:33 +0000 (05:20 +0000)
committerGlenn Morris <rgm@gnu.org>
Wed, 28 Nov 2007 05:20:33 +0000 (05:20 +0000)
(comment-region-internal): Fix newline insertion in `block' case.

lisp/ChangeLog
lisp/newcomment.el

index ec3b5cdd686442689802166306ca59b8afa3cab9..de6d85c7f8b5e26934a57d8e5f2c4f88d4fd24f2 100644 (file)
@@ -1,3 +1,8 @@
+2007-11-28  Martin Rudalics  <rudalics@gmx.at>
+
+       * newcomment.el (comment-region-internal): Fix newline insertion
+       in `block' case.
+
 2007-11-28  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * pcvs-parse.el (cvs-parse-table): Adjust regexp for resurrections.
index 2de4fa025fd369a283eeabcf2567d66521e169d5..1841b51e3055356d7ae977d66aa9e1a4de889b7b 100644 (file)
@@ -969,9 +969,11 @@ 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 (not (or (eq comment-empty-lines t)
-                          (and comment-empty-lines (zerop (length ce)))))))
+                          (and comment-empty-lines (zerop (length ce))))))
+       ce-sanitized)
     ;; Sanitize CE and CCE.
     (if (and (stringp ce) (string= "" ce)) (setq ce nil))
+    (setq ce-sanitized ce)
     (if (and (stringp cce) (string= "" cce)) (setq cce nil))
     ;; If CE is empty, multiline cannot be used.
     (unless ce (setq ccs nil cce nil))
@@ -988,7 +990,7 @@ the region rather than at left margin."
       (goto-char end)
       ;; If the end is not at the end of a line and the comment-end
       ;; is implicit (i.e. a newline), explicitly insert a newline.
-      (unless (or ce (eolp)) (insert "\n") (indent-according-to-mode))
+      (unless (or ce-sanitized (eolp)) (insert "\n") (indent-according-to-mode))
       (comment-with-narrowing beg end
        (let ((min-indent (point-max))
              (max-indent 0))