comparison lisp/newcomment.el @ 29066:720287a2312f

(comment-region-internal): Go back to BEG after quoting the nested comment markers.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Mon, 22 May 2000 04:23:37 +0000
parents 238233843fc1
children c411f27154ee
comparison
equal deleted inserted replaced
29065:e8d5eb064973 29066:720287a2312f
4 4
5 ;; Author: code extracted from Emacs-20's simple.el 5 ;; Author: code extracted from Emacs-20's simple.el
6 ;; Maintainer: Stefan Monnier <monnier@cs.yale.edu> 6 ;; Maintainer: Stefan Monnier <monnier@cs.yale.edu>
7 ;; Keywords: comment uncomment 7 ;; Keywords: comment uncomment
8 ;; Version: $Name: $ 8 ;; Version: $Name: $
9 ;; Revision: $Id: newcomment.el,v 1.11 2000/05/19 15:37:41 monnier Exp $ 9 ;; Revision: $Id: newcomment.el,v 1.12 2000/05/21 00:27:31 monnier Exp $
10 10
11 ;; This file is part of GNU Emacs. 11 ;; This file is part of GNU Emacs.
12 12
13 ;; GNU Emacs is free software; you can redistribute it and/or modify 13 ;; GNU Emacs is free software; you can redistribute it and/or modify
14 ;; it under the terms of the GNU General Public License as published by 14 ;; it under the terms of the GNU General Public License as published by
662 (setq ,bindent (- ,bindent n))))))))))) 662 (setq ,bindent (- ,bindent n)))))))))))
663 663
664 (defun comment-region-internal (beg end cs ce 664 (defun comment-region-internal (beg end cs ce
665 &optional ccs cce block lines indent) 665 &optional ccs cce block lines indent)
666 "Comment region BEG..END. 666 "Comment region BEG..END.
667 CS and CE are the comment start resp. end string. 667 CS and CE are the comment start resp end string.
668 CCS and CCE are the comment continuation strings for the start resp. end 668 CCS and CCE are the comment continuation strings for the start resp end
669 of lines (default to CS and CE). 669 of lines (default to CS and CE).
670 BLOCK indicates that end of lines should be marked with either CCE, CE or CS 670 BLOCK indicates that end of lines should be marked with either CCE, CE or CS
671 \(if CE is empty) and that those markers should be aligned. 671 \(if CE is empty) and that those markers should be aligned.
672 LINES indicates that an extra lines will be used at the beginning and end 672 LINES indicates that an extra lines will be used at the beginning and end
673 of the region for CE and CS. 673 of the region for CE and CS.
700 (goto-char (point-min)) 700 (goto-char (point-min))
701 ;; Quote any nested comment marker 701 ;; Quote any nested comment marker
702 (comment-quote-nested comment-start comment-end nil) 702 (comment-quote-nested comment-start comment-end nil)
703 703
704 ;; Loop over all lines to find the needed indentations. 704 ;; Loop over all lines to find the needed indentations.
705 (goto-char (point-min))
705 (while 706 (while
706 (progn 707 (progn
707 (unless (looking-at "[ \t]*$") 708 (unless (looking-at "[ \t]*$")
708 (setq min-indent (min min-indent (current-indentation)))) 709 (setq min-indent (min min-indent (current-indentation))))
709 (end-of-line) 710 (end-of-line)
936 937
937 (provide 'newcomment) 938 (provide 'newcomment)
938 939
939 ;;; Change Log: 940 ;;; Change Log:
940 ;; $Log: newcomment.el,v $ 941 ;; $Log: newcomment.el,v $
942 ;; Revision 1.12 2000/05/21 00:27:31 monnier
943 ;; (comment-styles): New `box-multi'.
944 ;; (comment-normalize-vars): Better default for comment-continue to
945 ;; avoid whitespace-only continuations.
946 ;; (comment-search-forward): Always move even in the no-syntax case.
947 ;; (comment-padright): Only obey N if it's only obeyed for padleft.
948 ;; (comment-make-extra-lines): Better handling of empty continuations.
949 ;; Use `=' for the filler if comment-start has only one character.
950 ;; (uncomment-region): Try handling the special `=' filler.
951 ;; (comment-region): Allow LINES even if MULTI is nil.
952 ;; (comment-box): Choose box style based on comment-style.
953 ;;
941 ;; Revision 1.11 2000/05/19 15:37:41 monnier 954 ;; Revision 1.11 2000/05/19 15:37:41 monnier
942 ;; Fix license text and author. 955 ;; Fix license text and author.
943 ;; Move aliases (indent-for-comment, set-comment-column, kill-comment 956 ;; Move aliases (indent-for-comment, set-comment-column, kill-comment
944 ;; and indent-new-comment-line) to the beginning of the file. 957 ;; and indent-new-comment-line) to the beginning of the file.
945 ;; Get rid of the last few CLisms. 958 ;; Get rid of the last few CLisms.