1 ;;; comment.el --- AUCTeX style for `comment.sty'
3 ;; Copyright (C) 2007 Free Software Foundation, Inc.
5 ;; Author: Ralf Angeli <angeli@caeruleus.net>
6 ;; Maintainer: auctex-devel@gnu.org
10 ;; This file is part of AUCTeX.
12 ;; AUCTeX is free software; you can redistribute it and/or modify it
13 ;; under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation; either version 3, or (at your option)
17 ;; AUCTeX is distributed in the hope that it will be useful, but
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 ;; General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with AUCTeX; see the file COPYING. If not, write to the Free
24 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
29 ;; This file adds support for `comment.sty'.
38 '("includecomment" "Name")
39 '("excludecomment" "Name")
40 '("specialcomment" "Name" "Before commands" "After commands")
41 '("processcomment" "Name" "Each-line commands"
42 "Before commands" "After commands"))
44 (mapc 'LaTeX-add-environments LaTeX-comment-env-list)
46 (when (and (featurep 'font-latex)
47 (eq TeX-install-font-lock 'font-latex-setup))
48 ;; For syntactic fontification.
49 (add-to-list 'font-latex-syntactic-keywords-extra
50 ;; \begin is supposed to start at the beginning of a line.
51 `(,(format "^\\\\begin *{\\(?:%s\\)}.*\\(\n\\)"
52 (regexp-opt LaTeX-comment-env-list))
54 (add-to-list 'font-latex-syntactic-keywords-extra
55 ;; \end is supposed to start at the beginning of a line.
56 `(,(format "^\\(\\\\\\)end *{\\(?:%s\\)}"
57 (regexp-opt LaTeX-comment-env-list))
59 (font-latex-set-syntactic-keywords)
60 (font-latex-add-keywords '(("includecomment" "{")
61 ("excludecomment" "{")
62 ("specialcomment" "{{{")
63 ("processcomment" "{{{{"))
65 ;; Tell font-lock about the update.
66 (setq font-lock-set-defaults nil)
67 (font-lock-set-defaults))))
69 ;;; comment.el ends here