Blame style/comment.el

Packit f2bd10
;;; comment.el --- AUCTeX style for `comment.sty'
Packit f2bd10
Packit f2bd10
;; Copyright (C) 2007 Free Software Foundation, Inc.
Packit f2bd10
Packit f2bd10
;; Author: Ralf Angeli <angeli@caeruleus.net>
Packit f2bd10
;; Maintainer: auctex-devel@gnu.org
Packit f2bd10
;; Created: 2007-03-18
Packit f2bd10
;; Keywords: tex
Packit f2bd10
Packit f2bd10
;; This file is part of AUCTeX.
Packit f2bd10
Packit f2bd10
;; AUCTeX is free software; you can redistribute it and/or modify it
Packit f2bd10
;; under the terms of the GNU General Public License as published by
Packit f2bd10
;; the Free Software Foundation; either version 3, or (at your option)
Packit f2bd10
;; any later version.
Packit f2bd10
Packit f2bd10
;; AUCTeX is distributed in the hope that it will be useful, but
Packit f2bd10
;; WITHOUT ANY WARRANTY; without even the implied warranty of
Packit f2bd10
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit f2bd10
;; General Public License for more details.
Packit f2bd10
Packit f2bd10
;; You should have received a copy of the GNU General Public License
Packit f2bd10
;; along with AUCTeX; see the file COPYING.  If not, write to the Free
Packit f2bd10
;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
Packit f2bd10
;; 02111-1307, USA.
Packit f2bd10
Packit f2bd10
;;; Commentary:
Packit f2bd10
Packit f2bd10
;; This file adds support for `comment.sty'.
Packit f2bd10
Packit f2bd10
;;; Code:
Packit f2bd10
Packit f2bd10
(TeX-add-style-hook
Packit f2bd10
 "comment"
Packit f2bd10
 (lambda ()
Packit f2bd10
   ;; New symbols
Packit f2bd10
   (TeX-add-symbols
Packit f2bd10
    '("includecomment" "Name")
Packit f2bd10
    '("excludecomment" "Name")
Packit f2bd10
    '("specialcomment" "Name" "Before commands" "After commands")
Packit f2bd10
    '("processcomment" "Name" "Each-line commands"
Packit f2bd10
      "Before commands" "After commands"))
Packit f2bd10
   ;; New environments
Packit f2bd10
   (mapc 'LaTeX-add-environments LaTeX-comment-env-list)
Packit f2bd10
   ;; Fontification
Packit f2bd10
   (when (and (fboundp 'font-latex-add-keywords)
Packit f2bd10
	      (fboundp 'font-latex-update-font-lock)
Packit f2bd10
	      (eq TeX-install-font-lock 'font-latex-setup))
Packit f2bd10
     ;; For syntactic fontification.
Packit f2bd10
     (add-to-list 'font-latex-syntactic-keywords-extra
Packit f2bd10
		  ;; \begin is supposed to start at the beginning of a line.
Packit f2bd10
		  `(,(format "^\\\\begin *{%s}.*\\(\n\\)"
Packit f2bd10
			     (regexp-opt LaTeX-comment-env-list))
Packit f2bd10
		    (1 "!" t)))
Packit f2bd10
     (add-to-list 'font-latex-syntactic-keywords-extra
Packit f2bd10
		  ;; \end is supposed to start at the beginning of a line.
Packit f2bd10
		  `(,(format "^\\(\\\\\\)end *{%s}"
Packit f2bd10
			     (regexp-opt LaTeX-comment-env-list))
Packit f2bd10
		    (1 "!" t)))
Packit f2bd10
     (font-latex-add-keywords '(("includecomment" "{")
Packit f2bd10
				("excludecomment" "{")
Packit f2bd10
				("specialcomment" "{{{")
Packit f2bd10
				("processcomment" "{{{{"))
Packit f2bd10
			      'variable)
Packit f2bd10
     ;; Tell font-lock about the update.
Packit f2bd10
     (font-latex-update-font-lock t)))
Packit f2bd10
 LaTeX-dialect)
Packit f2bd10
Packit f2bd10
;;; comment.el ends here