"Fossies" - the Fresh Open Source Software Archive

Member "auctex-12.3/style/comment.el" (18 Oct 2020, 2550 Bytes) of package /linux/misc/auctex-12.3.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Lisp source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "comment.el": 12.2_vs_12.3.

    1 ;;; comment.el --- AUCTeX style for `comment.sty'
    2 
    3 ;; Copyright (C) 2007, 2018, 2020 Free Software Foundation, Inc.
    4 
    5 ;; Author: Ralf Angeli <angeli@caeruleus.net>
    6 ;; Maintainer: auctex-devel@gnu.org
    7 ;; Created: 2007-03-18
    8 ;; Keywords: tex
    9 
   10 ;; This file is part of AUCTeX.
   11 
   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)
   15 ;; any later version.
   16 
   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.
   21 
   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., 51 Franklin Street, Fifth Floor, Boston,
   25 ;; MA 02110-1301 USA.
   26 
   27 ;;; Commentary:
   28 
   29 ;; This file adds support for `comment.sty'.
   30 
   31 ;;; Code:
   32 
   33 ;; Silence the compiler:
   34 (declare-function font-latex-add-keywords
   35           "font-latex"
   36           (keywords class))
   37 
   38 (declare-function font-latex-set-syntactic-keywords
   39           "font-latex")
   40 
   41 (defvar font-latex-syntactic-keywords-extra)
   42 
   43 (TeX-add-style-hook
   44  "comment"
   45  (lambda ()
   46    ;; New symbols
   47    (TeX-add-symbols
   48     '("includecomment" "Name")
   49     '("excludecomment" "Name")
   50     '("specialcomment" "Name" "Before commands" "After commands")
   51     '("processcomment" "Name" "Each-line commands"
   52       "Before commands" "After commands"))
   53    ;; New environments
   54    (mapc 'LaTeX-add-environments LaTeX-comment-env-list)
   55    ;; Fontification
   56    (when (and (fboundp 'font-latex-add-keywords)
   57           (eq TeX-install-font-lock 'font-latex-setup))
   58      ;; For syntactic fontification.
   59      (add-to-list 'font-latex-syntactic-keywords-extra
   60           ;; \begin is supposed to start at the beginning of a line.
   61           `(,(format "^\\\\begin *{%s}.*\\(\n\\)"
   62                  (regexp-opt LaTeX-comment-env-list))
   63             (1 "!" t)))
   64      (add-to-list 'font-latex-syntactic-keywords-extra
   65           ;; \end is supposed to start at the beginning of a line.
   66           `(,(format "^\\(\\\\\\)end *{%s}"
   67                  (regexp-opt LaTeX-comment-env-list))
   68             (1 "!" t)))
   69      (font-latex-add-keywords '(("includecomment" "{")
   70                 ("excludecomment" "{")
   71                 ("specialcomment" "{{{")
   72                 ("processcomment" "{{{{"))
   73                   'variable)
   74      ;; Tell font-lock about the update.
   75      (font-latex-set-syntactic-keywords)))
   76  LaTeX-dialect)
   77 
   78 ;;; comment.el ends here