*** newcomment.el.~1.101.~ Mon Apr 2 07:45:08 2007 --- newcomment.el Thu May 10 10:38:22 2007 *************** *** 926,941 **** 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))))))) ;; Sanitize CE and CCE. (if (and (stringp ce) (string= "" ce)) (setq ce nil)) (if (and (stringp cce) (string= "" cce)) (setq cce nil)) ;; If CE is empty, multiline cannot be used. (unless ce (setq ccs nil cce nil)) ;; Should we mark empty lines as well ? (if (or ccs block lines) (setq no-empty nil)) ;; Make sure we have end-markers for BLOCK mode. ! (when block (unless ce (setq ce (comment-string-reverse cs)))) ;; If BLOCK is not requested, we don't need CCE. (unless block (setq cce nil)) ;; Continuation defaults to the same as CS and CE. --- 926,943 ---- 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)))))) ! 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)) ;; Should we mark empty lines as well ? (if (or ccs block lines) (setq no-empty nil)) ;; Make sure we have end-markers for BLOCK mode. ! (when (and block (not ce)) (setq ce (comment-string-reverse cs))) ;; If BLOCK is not requested, we don't need CCE. (unless block (setq cce nil)) ;; Continuation defaults to the same as CS and CE. *************** *** 945,951 **** (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)) (comment-with-narrowing beg end (let ((min-indent (point-max)) (max-indent 0)) --- 947,954 ---- (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-sanitized (eolp)) ! (insert "\n") (indent-according-to-mode)) (comment-with-narrowing beg end (let ((min-indent (point-max)) (max-indent 0)) *************** *** 1163,1169 **** (buffer-substring (point) (progn (move-to-left-margin) (point))))))))))))) ! ;;;###autoload (defun comment-indent-new-line (&optional soft) --- 1166,1172 ---- (buffer-substring (point) (progn (move-to-left-margin) (point))))))))))))) ! ;;;###autoload (defun comment-indent-new-line (&optional soft)