aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2003-07-04 22:45:26 +0000
committerStefan Monnier2003-07-04 22:45:26 +0000
commit79ca2b1157c027db726cfdd376538009adbbeb4f (patch)
treedd55710be5cadf8981c35135c2c5059120634347
parente54faddb96acd3580d48b9db7c1746f17b824dd6 (diff)
downloademacs-79ca2b1157c027db726cfdd376538009adbbeb4f.tar.gz
emacs-79ca2b1157c027db726cfdd376538009adbbeb4f.zip
(uncomment-region): Remove padding coming from
comment-start rather than just from comment-padding.
-rw-r--r--lisp/newcomment.el8
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."
669 (let* ((numarg (prefix-numeric-value arg)) 669 (let* ((numarg (prefix-numeric-value arg))
670 (ccs comment-continue) 670 (ccs comment-continue)
671 (srei (comment-padright ccs 're)) 671 (srei (comment-padright ccs 're))
672 (csre (comment-padright comment-start 're))
672 (sre (and srei (concat "^\\s-*?\\(" srei "\\)"))) 673 (sre (and srei (concat "^\\s-*?\\(" srei "\\)")))
673 spt) 674 spt)
674 (while (and (< (point) end) 675 (while (and (< (point) end)
@@ -697,8 +698,11 @@ comment markers."
697 (> (- (point) (point-min) (length comment-start)) 7)) 698 (> (- (point) (point-min) (length comment-start)) 7))
698 (> (count-lines (point-min) (point-max)) 2)) 699 (> (count-lines (point-min) (point-max)) 2))
699 (setq box t)) 700 (setq box t))
700 (when (looking-at (regexp-quote comment-padding)) 701 ;; Skip the padding. Padding can come from comment-padding and/or
701 (goto-char (match-end 0))) 702 ;; from comment-start, so we first check comment-start.
703 (if (or (save-excursion (goto-char (point-min)) (looking-at csre))
704 (looking-at (regexp-quote comment-padding)))
705 (goto-char (match-end 0)))
702 (when (and sre (looking-at (concat "\\s-*\n\\s-*" srei))) 706 (when (and sre (looking-at (concat "\\s-*\n\\s-*" srei)))
703 (goto-char (match-end 0))) 707 (goto-char (match-end 0)))
704 (if (null arg) (delete-region (point-min) (point)) 708 (if (null arg) (delete-region (point-min) (point))