]> git.eshelyaron.com Git - emacs.git/commitdiff
(uncomment-region): Remove padding coming from
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 4 Jul 2003 22:45:26 +0000 (22:45 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 4 Jul 2003 22:45:26 +0000 (22:45 +0000)
comment-start rather than just from comment-padding.

lisp/newcomment.el

index c73f4ef644fcf45484acd1e734b4f567e4208a6d..96c8f9cc41b6003107e839b7aaa53feb8522ff5d 100644 (file)
@@ -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))