diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2003-07-04 22:45:26 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2003-07-04 22:45:26 +0000 |
commit | 79ca2b1157c027db726cfdd376538009adbbeb4f (patch) | |
tree | dd55710be5cadf8981c35135c2c5059120634347 /lisp | |
parent | e54faddb96acd3580d48b9db7c1746f17b824dd6 (diff) | |
download | emacs-79ca2b1157c027db726cfdd376538009adbbeb4f.tar.gz |
(uncomment-region): Remove padding coming from
comment-start rather than just from comment-padding.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/newcomment.el | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/newcomment.el b/lisp/newcomment.el index c73f4ef644f..96c8f9cc41b 100644 --- a/lisp/newcomment.el +++ b/lisp/newcomment.el @@ -669,6 +669,7 @@ comment markers." (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 @@ comment markers." (> (- (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)) |