# HG changeset patch # User Stefan Monnier # Date 1057358726 0 # Node ID 400a9c7868fd398c4971d17caecf1f180e4062b4 # Parent 2b72fd42f02eea4e170cf50f950fe4553e225da4 (uncomment-region): Remove padding coming from comment-start rather than just from comment-padding. diff -r 2b72fd42f02e -r 400a9c7868fd lisp/newcomment.el --- a/lisp/newcomment.el Fri Jul 04 22:40:26 2003 +0000 +++ b/lisp/newcomment.el Fri Jul 04 22:45:26 2003 +0000 @@ -669,6 +669,7 @@ (let* ((numarg (prefix-numeric-value arg)) (ccs comment-continue) (srei (comment-padright ccs 're)) + (csre (comment-padright comment-start 're)) (sre (and srei (concat "^\\s-*?\\(" srei "\\)"))) spt) (while (and (< (point) end) @@ -697,8 +698,11 @@ (> (- (point) (point-min) (length comment-start)) 7)) (> (count-lines (point-min) (point-max)) 2)) (setq box t)) - (when (looking-at (regexp-quote comment-padding)) - (goto-char (match-end 0))) + ;; Skip the padding. Padding can come from comment-padding and/or + ;; from comment-start, so we first check comment-start. + (if (or (save-excursion (goto-char (point-min)) (looking-at csre)) + (looking-at (regexp-quote comment-padding))) + (goto-char (match-end 0))) (when (and sre (looking-at (concat "\\s-*\n\\s-*" srei))) (goto-char (match-end 0))) (if (null arg) (delete-region (point-min) (point))