Blame style/ifluatex.el

Packit f2bd10
;;; ifluatex.el --- AUCTeX style for `ifluatex.sty' version 1.3.
Packit f2bd10
Packit f2bd10
;; Copyright (C) 2014, 2016 Free Software Foundation, Inc.
Packit f2bd10
Packit f2bd10
;; Author: Davide G. M. Salvetti <salve@debian.org>
Packit f2bd10
;; Maintainer: auctex-devel@gnu.org
Packit f2bd10
;; Created: 2014-11-15
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 the
Packit f2bd10
;; Free Software Foundation; either version 3, or (at your option) any
Packit f2bd10
;; later version.
Packit f2bd10
Packit f2bd10
;; AUCTeX is distributed in the hope that it will be useful, but WITHOUT
Packit f2bd10
;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
Packit f2bd10
;; FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
Packit f2bd10
;; 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, see
Packit f2bd10
;; <http://www.gnu.org/licenses/>.
Packit f2bd10
Packit f2bd10
;;; Commentary:
Packit f2bd10
Packit f2bd10
;; This file adds support for `ifluatex.sty' 1.3.
Packit f2bd10
Packit f2bd10
;;; Code:
Packit f2bd10
Packit f2bd10
(defun LaTeX-ifluatex-set-exit-mark (optional)
Packit f2bd10
  "Discard OPTIONAL and set exit-mark to current point."
Packit f2bd10
  (set-marker exit-mark (point)))
Packit f2bd10
Packit f2bd10
(TeX-add-style-hook
Packit f2bd10
    "ifluatex"
Packit f2bd10
  (lambda ()
Packit f2bd10
    (TeX-add-symbols
Packit f2bd10
     '("ifluatex"
Packit f2bd10
       (TeX-arg-literal "%\n")
Packit f2bd10
       LaTeX-ifluatex-set-exit-mark
Packit f2bd10
       (TeX-arg-literal "\n\\else%\n\\fi%"))
Packit f2bd10
     '("luatexversion" 0)
Packit f2bd10
     '("luatexrevision" 0))
Packit f2bd10
    (TeX-declare-expert-macros
Packit f2bd10
     "ifluatex"
Packit f2bd10
     "ifluatex" "luatexversion" "luatexrevision")
Packit f2bd10
Packit f2bd10
    ;; This package is used to make it possible to compile a document with both
Packit f2bd10
    ;; LuaTeX and base TeX engines.  By setting `TeX-check-engine-list' to nil
Packit f2bd10
    ;; we ignore engine restrictions posed by other packages.
Packit f2bd10
    (setq TeX-check-engine-list nil)
Packit f2bd10
Packit f2bd10
    (when (and (featurep 'font-latex)
Packit f2bd10
	       (eq TeX-install-font-lock 'font-latex-setup))
Packit f2bd10
      (font-latex-add-keywords '(("luatexversion")
Packit f2bd10
				 ("luatexrevision"))
Packit f2bd10
			       'function)))
Packit f2bd10
  LaTeX-dialect)
Packit f2bd10
Packit f2bd10
(defvar LaTeX-ifluatex-package-options nil
Packit f2bd10
  "Package options for the ifluatex package.")
Packit f2bd10
Packit f2bd10
;;; ifluatex.el ends here