emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/newcomment.el


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/newcomment.el
Date: Tue, 10 Sep 2002 02:20:53 -0400

Index: emacs/lisp/newcomment.el
diff -c emacs/lisp/newcomment.el:1.51 emacs/lisp/newcomment.el:1.52
*** emacs/lisp/newcomment.el:1.51       Mon Sep  2 21:45:18 2002
--- emacs/lisp/newcomment.el    Tue Sep 10 02:20:52 2002
***************
*** 34,40 ****
  ;; - nested comments in sgml-mode are not properly quoted.
  ;; - single-char nestable comment-start can only do the "\\s<+" stuff
  ;;   if the corresponding closing marker happens to be right.
- ;; - comment-box in TeXinfo generate bogus comments @ccccc@
  ;; - uncomment-region with a numeric argument can render multichar
  ;;   comment markers invalid.
  ;; - comment-indent or comment-region when called inside a comment
--- 34,39 ----
***************
*** 614,620 ****
  
  ;;;###autoload
  (defun uncomment-region (beg end &optional arg)
!   "Uncomment each line in the BEG..END region.
  The numeric prefix ARG can specify a number of chars to remove from the
  comment markers."
    (interactive "*r\nP")
--- 613,619 ----
  
  ;;;###autoload
  (defun uncomment-region (beg end &optional arg)
!   "Uncomment each line in the BEG .. END region.
  The numeric prefix ARG can specify a number of chars to remove from the
  comment markers."
    (interactive "*r\nP")
***************
*** 624,629 ****
--- 623,631 ----
      (goto-char beg)
      (setq end (copy-marker end))
      (let ((numarg (prefix-numeric-value arg))
+         (ccs comment-continue)
+         (srei (comment-padright ccs 're))
+         (sre (and srei (concat "^\\s-*?\\(" srei "\\)")))
          spt)
        (while (and (< (point) end)
                  (setq spt (comment-search-forward end t)))
***************
*** 635,653 ****
                        (error "Can't find the comment end"))
                      (point)))
               (box nil)
!              (ccs comment-continue)
!              (srei (comment-padright ccs 're))
!              (sre (and srei (concat "^\\s-*?\\(" srei "\\)"))))
          (save-restriction
            (narrow-to-region spt ept)
            ;; Remove the comment-start.
            (goto-char ipt)
            (skip-syntax-backward " ")
-           ;; Check for special `=' used sometimes in comment-box.
-           (when (and (= (- (point) (point-min)) 1) (looking-at "=\\{7\\}"))
-             (skip-chars-forward "="))
            ;; A box-comment starts with a looong comment-start marker.
!           (when (> (- (point) (point-min) (length comment-start)) 7)
              (setq box t))
            (when (looking-at (regexp-quote comment-padding))
              (goto-char (match-end 0)))
--- 637,657 ----
                        (error "Can't find the comment end"))
                      (point)))
               (box nil)
!              (box-equal nil))    ;Whether we might be using `=' for boxes.
          (save-restriction
            (narrow-to-region spt ept)
+ 
            ;; Remove the comment-start.
            (goto-char ipt)
            (skip-syntax-backward " ")
            ;; A box-comment starts with a looong comment-start marker.
!           (when (and (or (and (= (- (point) (point-min)) 1)
!                               (setq box-equal t)
!                               (looking-at "=\\{7\\}")
!                               (not (eq (char-before (point-max)) ?\n))
!                               (skip-chars-forward "="))
!                          (> (- (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)))
***************
*** 660,666 ****
            ;; Remove the end-comment (and leading padding and such).
            (goto-char (point-max)) (comment-enter-backward)
            ;; Check for special `=' used sometimes in comment-box.
!           (when (= (- (point-max) (point)) 1)
              (let ((pos (point)))
                ;; skip `=' but only if there are at least 7.
                (when (> (skip-chars-backward "=") -7) (goto-char pos))))
--- 664,670 ----
            ;; Remove the end-comment (and leading padding and such).
            (goto-char (point-max)) (comment-enter-backward)
            ;; Check for special `=' used sometimes in comment-box.
!           (when (and box-equal (not (eq (char-before (point-max)) ?\n)))
              (let ((pos (point)))
                ;; skip `=' but only if there are at least 7.
                (when (> (skip-chars-backward "=") -7) (goto-char pos))))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]