comparison lisp/newcomment.el @ 39864:71f93e410115

(comment-region-internal): Don't rebind invisibility_spec now that the C routines handle it correctly.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 12 Oct 2001 22:37:51 +0000
parents 1cf8ddfb831f
children c07719cfdfcd
comparison
equal deleted inserted replaced
39863:345caf35c534 39864:71f93e410115
3 ;; Copyright (C) 1999, 2000 Free Software Foundation Inc. 3 ;; Copyright (C) 1999, 2000 Free Software Foundation Inc.
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 ;; Revision: $Id: newcomment.el,v 1.35 2001/09/27 21:13:44 monnier Exp $ 8 ;; Revision: $Id: newcomment.el,v 1.36 2001/10/11 01:44:48 monnier Exp $
9 9
10 ;; This file is part of GNU Emacs. 10 ;; This file is part of GNU Emacs.
11 11
12 ;; GNU Emacs is free software; you can redistribute it and/or modify 12 ;; GNU Emacs is free software; you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by 13 ;; it under the terms of the GNU General Public License as published by
763 ;; If the end is not at the end of a line and the comment-end 763 ;; If the end is not at the end of a line and the comment-end
764 ;; is implicit (i.e. a newline), explicitly insert a newline. 764 ;; is implicit (i.e. a newline), explicitly insert a newline.
765 (unless (or ce (eolp)) (insert "\n") (indent-according-to-mode)) 765 (unless (or ce (eolp)) (insert "\n") (indent-according-to-mode))
766 (comment-with-narrowing beg end 766 (comment-with-narrowing beg end
767 (let ((min-indent (point-max)) 767 (let ((min-indent (point-max))
768 (max-indent 0) 768 (max-indent 0))
769 ;; We rebind the invisibility spec because move-to-column
770 ;; skips invisible text. Only reveal ellipses.
771 (buffer-invisibility-spec
772 (if (listp buffer-invisibility-spec)
773 (mapcar (lambda (x) (if (cdr-safe x) t x))
774 buffer-invisibility-spec)
775 buffer-invisibility-spec)))
776 (goto-char (point-min)) 769 (goto-char (point-min))
777 ;; Quote any nested comment marker 770 ;; Quote any nested comment marker
778 (comment-quote-nested comment-start comment-end nil) 771 (comment-quote-nested comment-start comment-end nil)
779 772
780 ;; Loop over all lines to find the needed indentations. 773 ;; Loop over all lines to find the needed indentations.