AUCTeX Sync -- New Style Files
[packages] / xemacs-packages / auctex / style / ifluatex.el
1 ;;; ifluatex.el --- AUCTeX style for `ifluatex.sty' version 1.3.
2
3 ;; Copyright (C) 2014, 2016 Free Software Foundation, Inc.
4
5 ;; Author: Davide G. M. Salvetti <salve@debian.org>
6 ;; Maintainer: auctex-devel@gnu.org
7 ;; Created: 2014-11-15
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 the
14 ;; Free Software Foundation; either version 3, or (at your option) any
15 ;; later version.
16
17 ;; AUCTeX is distributed in the hope that it will be useful, but WITHOUT
18 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 ;; FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
20 ;; 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, see
24 ;; <http://www.gnu.org/licenses/>.
25
26 ;;; Commentary:
27
28 ;; This file adds support for `ifluatex.sty' 1.3.
29
30 ;;; Code:
31
32 (defun LaTeX-ifluatex-set-exit-mark (optional)
33   "Discard OPTIONAL and set exit-mark to current point."
34   (set-marker exit-mark (point)))
35
36 (TeX-add-style-hook
37     "ifluatex"
38   (lambda ()
39     (TeX-add-symbols
40      '("ifluatex"
41        (TeX-arg-literal "%\n")
42        LaTeX-ifluatex-set-exit-mark
43        (TeX-arg-literal "\n\\else%\n\\fi%"))
44      '("luatexversion" 0)
45      '("luatexrevision" 0))
46     (TeX-declare-expert-macros
47      "ifluatex"
48      "ifluatex" "luatexversion" "luatexrevision")
49
50     ;; This package is used to make it possible to compile a document with both
51     ;; LuaTeX and base TeX engines.  By setting `TeX-check-engine-list' to nil
52     ;; we ignore engine restrictions posed by other packages.
53     (setq TeX-check-engine-list nil)
54
55     (when (and (featurep 'font-latex)
56                (eq TeX-install-font-lock 'font-latex-setup))
57       (font-latex-add-keywords '(("luatexversion")
58                                  ("luatexrevision"))
59                                'function)))
60   LaTeX-dialect)
61
62 (defvar LaTeX-ifluatex-package-options nil
63   "Package options for the ifluatex package.")
64
65 ;;; ifluatex.el ends here