]> code.delx.au - gnu-emacs-elpa/blob - packages/auctex/style/shortvrb.el
Remove version numbers in packages/ directory
[gnu-emacs-elpa] / packages / auctex / style / shortvrb.el
1 ;;; shortvrb.el --- AUCTeX style for `shortvrb.sty'
2
3 ;; Copyright (C) 2009 Free Software Foundation, Inc.
4
5 ;; Author: Ralf Angeli <angeli@caeruleus.net>
6 ;; Maintainer: auctex-devel@gnu.org
7 ;; Created: 2009-12-23
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 St, Fifth Floor, Boston, MA
25 ;; 02110-1301, USA.
26
27 ;;; Commentary:
28
29 ;; This file adds support for `shortvrb.sty'.
30
31 ;; XXX: We might want provide users with the possibility to activate
32 ;; something like this for any file (incl. Plain TeX). That would
33 ;; bring us one step closer to the goal of displaying texbook.tex
34 ;; without font locking going haywire.
35
36 ;; FIXME: The code does not work for preview.dtx because in that file
37 ;; the style list is empty. In its master file, preview.drv, it
38 ;; works, however. However, even if the style file is loaded by hand,
39 ;; it fails to fontify verbatim text in the documentation parts of the
40 ;; file.
41
42 ;;; Code:
43
44 (TeX-add-style-hook
45 "shortvrb"
46 (lambda ()
47 ;; Fontification
48 (when (and LaTeX-shortvrb-chars
49 (fboundp 'font-latex-set-syntactic-keywords)
50 (eq TeX-install-font-lock 'font-latex-setup))
51 (let (syntax-alist)
52 (dolist (char LaTeX-shortvrb-chars)
53 (add-to-list 'syntax-alist (cons char "|")))
54 (font-latex-add-to-syntax-alist syntax-alist)))))
55
56 ;;; shortvrb.el ends here