aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2007-11-28 05:20:33 +0000
committerGlenn Morris2007-11-28 05:20:33 +0000
commit53dd1d5387118581452983cefee8ed801c4e8079 (patch)
tree03c0c68ed5ff969488a5b34ea4155079cbc966f5
parentd0aa78bc6e0249f342a0f1d35b1af024e6c8b55b (diff)
downloademacs-53dd1d5387118581452983cefee8ed801c4e8079.tar.gz
emacs-53dd1d5387118581452983cefee8ed801c4e8079.zip
Martin Rudalics <rudalics at gmx.at>
(comment-region-internal): Fix newline insertion in `block' case.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/newcomment.el6
2 files changed, 9 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ec3b5cdd686..de6d85c7f8b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12007-11-28 Martin Rudalics <rudalics@gmx.at>
2
3 * newcomment.el (comment-region-internal): Fix newline insertion
4 in `block' case.
5
12007-11-28 Stefan Monnier <monnier@iro.umontreal.ca> 62007-11-28 Stefan Monnier <monnier@iro.umontreal.ca>
2 7
3 * pcvs-parse.el (cvs-parse-table): Adjust regexp for resurrections. 8 * pcvs-parse.el (cvs-parse-table): Adjust regexp for resurrections.
diff --git a/lisp/newcomment.el b/lisp/newcomment.el
index 2de4fa025fd..1841b51e305 100644
--- a/lisp/newcomment.el
+++ b/lisp/newcomment.el
@@ -969,9 +969,11 @@ INDENT indicates to put CS and CCS at the current indentation of
969the region rather than at left margin." 969the region rather than at left margin."
970 ;;(assert (< beg end)) 970 ;;(assert (< beg end))
971 (let ((no-empty (not (or (eq comment-empty-lines t) 971 (let ((no-empty (not (or (eq comment-empty-lines t)
972 (and comment-empty-lines (zerop (length ce))))))) 972 (and comment-empty-lines (zerop (length ce))))))
973 ce-sanitized)
973 ;; Sanitize CE and CCE. 974 ;; Sanitize CE and CCE.
974 (if (and (stringp ce) (string= "" ce)) (setq ce nil)) 975 (if (and (stringp ce) (string= "" ce)) (setq ce nil))
976 (setq ce-sanitized ce)
975 (if (and (stringp cce) (string= "" cce)) (setq cce nil)) 977 (if (and (stringp cce) (string= "" cce)) (setq cce nil))
976 ;; If CE is empty, multiline cannot be used. 978 ;; If CE is empty, multiline cannot be used.
977 (unless ce (setq ccs nil cce nil)) 979 (unless ce (setq ccs nil cce nil))
@@ -988,7 +990,7 @@ the region rather than at left margin."
988 (goto-char end) 990 (goto-char end)
989 ;; If the end is not at the end of a line and the comment-end 991 ;; If the end is not at the end of a line and the comment-end
990 ;; is implicit (i.e. a newline), explicitly insert a newline. 992 ;; is implicit (i.e. a newline), explicitly insert a newline.
991 (unless (or ce (eolp)) (insert "\n") (indent-according-to-mode)) 993 (unless (or ce-sanitized (eolp)) (insert "\n") (indent-according-to-mode))
992 (comment-with-narrowing beg end 994 (comment-with-narrowing beg end
993 (let ((min-indent (point-max)) 995 (let ((min-indent (point-max))
994 (max-indent 0)) 996 (max-indent 0))