comparison lisp/newcomment.el @ 3289:f97e1a4cbc28

[xemacs-hg @ 2006-03-17 17:05:06 by james] Remove an old block of code that breaks uncomment-region on C files and does not appear to help with its purpoted use on Elisp files. See xemacs-patches message <m3bqw7jjat.fsf@jerrypc.cs.usu.edu>.
author james
date Fri, 17 Mar 2006 17:05:07 +0000
parents b9a1074dc6bf
children 1e2fc51563a5
comparison
equal deleted inserted replaced
3288:f45c9ff6f425 3289:f97e1a4cbc28
650 (if (> beg end) (let (mid) (setq mid beg beg end end mid))) 650 (if (> beg end) (let (mid) (setq mid beg beg end end mid)))
651 (save-excursion 651 (save-excursion
652 (goto-char beg) 652 (goto-char beg)
653 (setq end (copy-marker end)) 653 (setq end (copy-marker end))
654 654
655 ;; XEmacs: Add the following clause
656
657 ;; if user didn't specify how many comments to remove, be smart
658 ;; and remove the minimal number that all lines have. that way,
659 ;; comments in a region of Elisp code that gets commented out will
660 ;; get put back correctly.
661 (if (null arg)
662 (let ((min-comments 999999))
663 (while (not (eobp))
664 (let ((this-comments 0))
665 (while (looking-at (regexp-quote comment-start))
666 (incf this-comments)
667 (forward-char (length comment-start)))
668 (if (and (> this-comments 0) (< this-comments min-comments))
669 (setq min-comments this-comments))
670 (forward-line 1)))
671 (if (< min-comments 999999)
672 (setq arg (list min-comments)))
673 (goto-char beg)))
674
675 (let* ((numarg (prefix-numeric-value arg)) 655 (let* ((numarg (prefix-numeric-value arg))
676 (ccs comment-continue) 656 (ccs comment-continue)
677 (srei (comment-padright ccs 're)) 657 (srei (comment-padright ccs 're))
678 (sre (and srei (concat "^\\s-*?\\(" srei "\\)"))) 658 (sre (and srei (concat "^\\s-*?\\(" srei "\\)")))
679 spt) 659 spt)